findbugs-maven-plugin doesn't do anything

微笑、不失礼 提交于 2019-12-12 10:34:39

问题


I don't get it... I want to enable findbugs report in a Maven 3 project site and did it by adding this to my pom.xml (As described here):

<project>
  ...
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>2.4.0</version>
      </plugin>
    </plugins>
  </reporting>
  ...
</project>

Then I ran mvn site but no report is generated. Interesting thing is when I use version 2.3.1 instead then a report is generated. But 2.3.2 or 2.4.0 doesn't work. When running mvn site -X then the relevant output is this:

[DEBUG] Inside canGenerateReport..... false 
[DEBUG] canGenerate is false
[DEBUG] class org.codehaus.mojo.findbugs.FindBugsGui isMavenReport: false
[DEBUG] skip non MavenReport org.codehaus.mojo:findbugs-maven-plugin:2.4.0:gui

What is this canGenerate stuff? What's going wrong here?


回答1:


Ah, found the problem. The project must be compiled first. Plugin version 2.3.1 triggered a compile automatically but since 2.3.2 this is no longer the case. So after a mvn clean I have to run mvn compile site to get a report.



来源:https://stackoverflow.com/questions/8939008/findbugs-maven-plugin-doesnt-do-anything

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!