I have maven 3, cobertura maven plugin 2.51 and some classe. I need to know test coverage of my class. But I don t want to test setters/getters. So I wand just to ignore them.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<formats>
<format>html</format>
<format>xml</format>
</formats>
<check>
<haltOnFailure>false</haltOnFailure>
<lineRate>55</lineRate>
<branchRate>60</branchRate>
<packageLineRate>60</packageLineRate>
<packageBranchRate>60</packageBranchRate>
<totalLineRate>60</totalLineRate>
<totalBranchRate>60</totalBranchRate>
</check>
<instrumentation>
<excludes>
<exclude>com/FileCopier*.*</exclude>
<exclude>com/FileCopierWithCamel*.*</exclude>
<exclude>com/Main*.*</exclude>
</excludes>
</instrumentation>
</configuration>
<executions>
<execution>
<goals>
<goal>clean</goal>
<goal>cobertura</goal>
<goal>check</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
接着,我又说,在被忽略的情况下,我 block倒了。
<ignores>
<!-- Ignore all setter and getter methods in your classes -->
<ignore>com.*.set*</ignore>
<ignore>com.*.get*</ignore>
<ignore>com.MyClass.getName</ignore>
</ignores>
但似乎与工作不一样。
I found this link: http://jira.codehaus.org/browse/MCOBERTURA-52 Looks like this problem is about 5 year old. Is there any solution of my problem?