Maven2之 report常用plugin

本文介绍五款Maven质量插件:findbugs-maven-plugin用于查找Java程序中的潜在错误;cobertura-maven-plugin帮助评估单元测试覆盖率;maven-project-info-reports-plugin生成项目信息报告;taglist-maven-plugin标记代码中的待办事项;maven-surefire-report-plugin呈现测试结果报告。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、findbugs-maven-plugin

      http://mojo.codehaus.org/findbugs-maven-plugin/

      FindBugs looks for bugs in Java programs. It is based on the concept of bug patterns.

 

Pom代码 复制代码  收藏代码
  1. <plugin>  
  2.     <groupId>org.codehaus.mojo</groupId>  
  3.     <artifactId>findbugs-maven-plugin</artifactId>  
  4.     <version>2.3.1</version>  
  5.     <configuration>  
  6.         <xmlOutput>true</xmlOutput>  
  7.         <xmlOutputDirectory>target/site</xmlOutputDirectory>  
  8.     </configuration>  
  9. </plugin>  

 

 

2、cobertura-maven-plugin

      http://mojo.codehaus.org/cobertura-maven-plugin/

      The report generated by this plugin is the result of executing the Cobertura tool against your compiled classes to help you determine how well the unit testing efforts have been, and can then be used to identify which parts of your Java program are lacking test coverage.

 

Pom代码 复制代码  收藏代码
  1. <plugin>  
  2.     <groupId>org.codehaus.mojo</groupId>  
  3.     <artifactId>cobertura-maven-plugin</artifactId>  
  4.     <version>2.2</version>  
  5.     <configuration>  
  6.         <formats>  
  7.             <format>html</format>  
  8.             <format>xml</format>  
  9.         </formats>  
  10.         <instrumentation>  
  11.             <excludes></excludes>  
  12.         </instrumentation>  
  13.     </configuration>  
  14. </plugin>  

 

 

3、maven-project-info-reports-plugin

      http://maven.apache.org/plugins/maven-project-info-reports-plugin/

      The Maven Project Info Reports plugin is used to generate reports information about the project.

      eg. project-info-reports:dependencies is used to generate the Project Dependencies report.

 

Pom代码 复制代码  收藏代码
  1. <plugin>  
  2.     <groupId>org.apache.maven.plugins</groupId>  
  3.     <artifactId>maven-project-info-reports-plugin</artifactId>  
  4.     <version>2.1</version>  
  5.     <reportSets>  
  6.         <reportSet>  
  7.             <reports>  
  8.                 <report>dependencies</report>  
  9.                 <report>index</report>  
  10.             </reports>  
  11.         </reportSet>  
  12.     </reportSets>  
  13. </plugin>  

 

 

4、taglist-maven-plugin

      http://mojo.codehaus.org/taglist-maven-plugin/

      The Taglist Maven Plugin generates a report on various tags found in the code, like @todo or //TODO tags.

 

Pom代码 复制代码  收藏代码
  1. <plugin>  
  2.     <groupId>org.codehaus.mojo</groupId>  
  3.     <artifactId>taglist-maven-plugin</artifactId>  
  4.     <version>2.4</version>  
  5.     <configuration>  
  6.         <tags>  
  7.             <tag>TODO</tag>  
  8.             <tag>@TODO</tag>  
  9.             <tag>FIXME</tag>  
  10.         </tags>  
  11.     </configuration>  
  12. </plugin>  

 

 

5、maven-surefire-report-plugin

      http://maven.apache.org/plugins/maven-surefire-report-plugin/

      The Surefire Report Plugin parses the generated TEST-*.xml files under ${basedir}/target/surefire-reports and renders them to DOXIA which creates the web interface version of the test results.

 

Pom代码 复制代码  收藏代码
  1. <plugin>  
  2.     <groupId>org.apache.maven.plugins</groupId>  
  3.     <artifactId>maven-surefire-report-plugin</artifactId>  
  4.     <version>2.4.2</version>  
  5.     <configuration>  
  6.         <showSuccess>false</showSuccess>  
  7.     </configuration>  
  8. </plugin>  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值