Nee*_*raj 10 instrumentation maven-2 code-coverage cobertura maven-plugin
我一直在使用Cobertura插件进行报告生成和检测(使用surefire).这是我面临的问题:
我无法为我的项目中的特定类生成插件忽略报告生成.
PF低于pom.xml的相关摘录,我添加了ignore标记,但这只是忽略了忽略类的检测.
我希望根本不生成特定项目的报告.
首先,由于我对Maven和Conberture的了解有限,我想知道它是否可能,如果是,那么我需要在pom.xml中完成哪些更改.
的pom.xml
<report>
<!-- other plugins exist but are not important to be listed here I guess -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>false</skipTests>
<systemProperties>
<property>
<name>net.sourceforge.cobertura.datafile</name>
<value>target/cobertura/cobertura.ser</value>
</property>
</systemProperties>
</configuration>
</plugin>
<!-- The following is the plugin for cobertura, which takes care of integration and report generation-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<configuration>
<check>
<branchRate>50</branchRate>
<lineRate>50</lineRate>
<haltOnFailure>true</haltOnFailure>
<totalBranchRate>50</totalBranchRate>
<totalLineRate>50</totalLineRate>
<packageLineRate>50</packageLineRate>
<packageBranchRate>50</packageBranchRate>
</check>
<instrumentation>
<ignores>
<ignore>deshaw.dportal.alert.*</ignore>
<ignore>deshaw.dportal.atc.*</ignore>
<ignore>deshaw.dportal.basket.*</ignore>
<ignore>deshaw.dportal.fcs.*</ignore>
<ignore>deshaw.dportal.event.*</ignore>
<ignore>deshaw.dportal.filings.*</ignore>
<ignore>deshaw.dportal.glg.*</ignore>
<ignore>deshaw.dportal.icp.*</ignore>
</ignores>
</instrumentation>
</configuration>
</plugin>
</report>
Run Code Online (Sandbox Code Playgroud)
编辑:
这是我的目录结构:
module
|
|-apps
| |-alert
| | |-src
| | |-target
| | |-pom.xml
| |-------------------
| |-company
| | |-src
| | |-target
| | |-pom.xml
|-----------------------
|-jobs
| |-job1
| | |-src
| | |-target
| | |-pom.xml
| |-job2
| | |-src
| | |-target
| | |-pom.xml
Run Code Online (Sandbox Code Playgroud)
我在module/pom.xml中尝试了以下内容
<instrumentation>
<excludes>
<exclude>**/apps/*.*</exclude>
</excludes>
</instrumentation>
Run Code Online (Sandbox Code Playgroud)
我仍然在警报和公司目录中生成报告.
可能排除正则表达式不对吗?
Cobertura maven 插件不尊重报告生成的排除和忽略。但它对于检测是这样做的。
报告的已知错误: http: //jira.codehaus.org/browse/MCOBERTURA-52