首页 > 应用开发 > IT综合 > Maven2 用于度量和品质保证的插件
Maven2 用于度量和品质保证的插件
checkstyle 检查编码风格
常用的goal
checkstyle:checkstyle
备注
可以用eclipse-cs编辑检查规则http://eclipse-cs.sourceforge.net/index.shtml
surefire-report 生成单元测试报告
常用的goal
surefire-report:report
jdepend 生成包的度量报告
常用的goal
jdepend:generate
findbugs 检查潜在的缺陷
常用的goal
findbugs:findbugs
cobertura 生成测试覆盖率报告
常用的goal
cobertura:cobertura
备注
直接从官方镜像下载的版本有个bug,不能正确生成报告(参见http://jira.codehaus.org/browse/MCOBERTURA-61)可以下载补丁后的jar替换本地repository的
jdk1.4对应的补丁: http://dist.codehaus.org/mule/dependencies/maven2/cobertura/cobertura/1.8/cobertura-1.8.jar
jdk5对应的补丁:http://www.artofsolving.com/files/m2/cobertura-1.8.jar
以上是一些常用的用于品质管理的插件。默认情况下都不用配置,相当方便。如果需要手动配置的话,根据网上的文档也相当容易配置。
apache的maven plugin页面: http://maven.apache.org/plugins/
codehaus mojo 页面: http://mojo.codehaus.org
创建web项目
mvn archetype:create -DgroupId=com.junglesong.mytodo -DartifactId=mytodo -DarchetypeArtifactId=maven-archetype-webapp
[@more@]来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/249132/viewspace-922289/ ,如需转载,请注明出处,否则将追究法律责任。