代码之家  ›  专栏  ›  技术社区  ›  hotmeatballsoup

未使用mvn site命令执行Maven Findbugs插件

  •  2
  • hotmeatballsoup  · 技术社区  · 6 年前

    我正试图让Findbugs使用现有的/成熟的Maven项目。

    <plugins> 我的标签 pom.xml :

    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>findbugs-maven-plugin</artifactId>
      <version>3.0.5</version>
      <configuration>
        <effort>Max</effort>
        <threshold>Low</threshold>
        <xmlOutput>true</xmlOutput>
      </configuration>
    </plugin>
    

    mvn site . 因为我的项目的生成调用是aleady:

    mvn clean jacoco:prepare-agent test site jxr:jxr -Dkey1=123 -Dkey2=456 -Denvironment=DEV
    

    enter image description here

    从这里我找不到任何“Findbugs”报告或任何提到Findbugs的东西。当我为Findbugs做grep时( grep -rl "findbugs" . ./target/surefire-reports/TEST-*.xml 文件有一个术语” 查找Bugs “他们提到过。

    值得一提的是 见a target/site/findbugs.html 成功生成后的文件。。。

    1 回复  |  直到 6 年前
        1
  •  1
  •   Juan Mellado user183856    6 年前

    您应该在 <plugins> 部分 <reporting> 你的部分 pom.xml :

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

    问题是 < ,不确定这是否是问题所在。