---
title: "java coverage exclude使用"
author: "Goldice"
date: "2015-07-21T23:29:14Z"
tags: []
categories: ["编程语言"]
slug: "java-coverage-exclude"
draft: false
lastmod: "2015-07-21T23:29:14Z"
id: 2229205
url: "https://jdoc.iteye.com/blog/2229205"
---

使用cobertura：[http://mojo.codehaus.org/cobertura-maven-plugin/usage.html](http://mojo.codehaus.org/cobertura-maven-plugin/usage.html)

若想要忽略一部分代码，可以通过`exclude`来指定：

```
<configuration> 
    <instrumentation>
        <excludes>
            <exclude>com/alibaba/ws/gcenter/web/**/*.class</exclude>        
        </excludes>
    </instrumentation>
</configuration>
```

注意，使用`/**/`来匹配路径