簡體   English   中英

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

[英]Maven Findbugs plugin not executing with mvn site command

我正在嘗試讓 Findbugs 與現有/成熟的 Maven 項目一起工作。

我在pom.xml<plugins>標簽中添加了以下內容:

<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>

然后我看到 Findbugs 插件在您運行mvn site時運行。 由於我的項目的構建調用是 aleady:

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

...我只是像往常一樣運行它。 構建成功,我在瀏覽器中轉到我的正常站點摘要:

在此處輸入圖片說明

從這里我找不到任何“Findbugs”報告或任何提到 Findbugs 的內容。 當我為 Findbugs ( grep -rl "findbugs" . ) 執行 grep 時,我確實看到我的許多./target/surefire-reports/TEST-*.xml文件中提到了術語“ findbugs ”。

值得一提的是,在成功構建后我沒有看到target/site/findbugs.html文件...

關於在哪里可以在我的站點摘要(或其他任何地方)下找到 HTML Findbugs 輸出的任何想法? 尋找一個很好的 HTML 報告,顯示哪些(如果有)Findbugs 檢查失敗。

您應該在pom.xml<reporting>部分的<plugins>部分中添加 FindBugs 插件:

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

問題只是說明<plugins> ,不確定這是否可能是問題所在。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM