我一直在使用 Cobertura 插件来生成报告和检测(当然)。这是我面临的问题:
我无法让插件忽略我项目中特定类的报告生成。
PF 在 pom.xml 的相关摘录下方,我添加了忽略标记,但这只是忽略了被忽略类的检测。
我希望根本不生成特定项目的报告。
首先,由于我对 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>
编辑:
这是我的目录结构:
module
|
|-apps
| |-alert
| | |-src
| | |-target
| | |-pom.xml
| |-------------------
| |-company
| | |-src
| | |-target
| | |-pom.xml
|-----------------------
|-jobs
| |-job1
| | |-src
| | |-target
| | |-pom.xml
| |-job2
| | |-src
| | |-target
| | |-pom.xml
我在 module/pom.xml 中尝试了以下内容
<instrumentation>
<excludes>
<exclude>**/apps/*.*</exclude>
</excludes>
</instrumentation>
我仍然在警报和公司目录中生成报告。
可能排除正则表达式不正确?