简体   繁体   English

如何使用findbugs-maven-plugin生成1个报告?

[英]How to generate 1 report with findbugs-maven-plugin?

I would like to generate one global xml report with findbugs plug-in. 我想用findbugs插件生成一个全局xml报告。 My tree : 我的树:

pom.xml
 └── /project 1
      └── pom.xml
 └── /project 2
       └── pom.xml

and my parent pom.xml : 和我的父pom.xml:

<plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>findbugs-maven-plugin</artifactId>
     <version>2.5.3</version>
     <configuration>
                <skip>true</skip>
                <xmlOutput>true</xmlOutput>
                <findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory>
     </configuration>
</plugin>

Actually the command mvn compile findbugs:findbugs generate one xml report per project. 实际上命令mvn compile findbugs:findbugs为每个项目生成一个xml报告。

Thanks in advance !! 提前致谢 !!

Well, getting Maven to do things differently can be tough. 好吧,让Maven以不同的方式做事情可能很难。

A workaround might be to use the UnionBugs command to combine all your FindBugs reports in the end. 解决方法可能是使用UnionBugs命令最终组合所有FindBugs报告。 The UnionBugs command seems to be based on work by Peter Franza , who also explains the Ant task for this. UnionBugs命令似乎是基于Peter Franza的工作 ,他也解释了Ant的任务。 The UnionBugs Ant task is part of standard FindBugs. UnionBugs Ant任务是标准FindBugs的一部分。

Here's how to run an Ant task from Maven . 以下是如何从Maven运行Ant任务 Since you are using Jenkins, you can also simply define an Ant step after your Maven step in the Jenkins job configuration. 由于您使用的是Jenkins,因此您还可以在Jenkins作业配置中的Maven步骤之后简单地定义Ant步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM