簡體   English   中英

Maven Findbugs在站點生命周期中不生成報告

[英]Maven Findbugs not producing reports in site lifecycle

我正在嘗試為站點報告創建Findbugs HTML報告。 我終於讓Findbugs實際運行(在跳過之前),因為我必須在find bugs報告的<build>階段中包含目標findbugs 但是,即使我在<reporting>部分中定義了findbugs.html也不會生成findbugs.html <reporting>

這是我的Findbugs配置:

<build>
    <plugins>
        ...
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>2.5.2</version>
            <configuration>
                <xmlOutput>true</xmlOutput>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>findbugs</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
      ....
    <plugins>
</build>
....
<reporting>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>2.5.2</version>
            <configuration>
                <xmlOutput>true</xmlOutput>
                <failOnError>false</failOnError>
                <xmlOutput>true</xmlOutput>
                <skip>false</skip>
            </configuration>
        </plugin>
    </plugins>
<reporting>

我的執行如下所示:

$ mvn clean site
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building project 2.0.4
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ crypto ---
[INFO] Deleting target
[INFO] 
[INFO] --- maven-site-plugin:3.3:site (default-site) @ crypto ---
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:2.7
[INFO] configuring report plugin org.codehaus.mojo:findbugs-maven-plugin:2.5.2
[INFO] configuring report plugin org.apache.maven.plugins:maven-pmd-plugin:3.0.1
[INFO] configuring report plugin org.apache.maven.plugins:maven-javadoc-plugin:2.9.1
[INFO] 
[INFO] >>> maven-javadoc-plugin:2.9.1:aggregate (report:aggregate) @ crypto >>>
[INFO] 
[INFO] --- axis2-wsdl2code-maven-plugin:1.5.6:wsdl2code (default) @ crypto ---
Retrieving document at 'src/main/wsdl/Tokenizer.wsdl'.
[INFO] 
[INFO] --- build-helper-maven-plugin:1.8:add-source (add-source) @ crypto ---
[INFO] Source directory: target/generated-sources added.
[INFO] 
[INFO] <<< maven-javadoc-plugin:2.9.1:aggregate (report:aggregate) @ crypto <<<
[INFO] 
[INFO] >>> maven-javadoc-plugin:2.9.1:test-aggregate (report:test-aggregate) @ crypto >>>
[INFO] 
[INFO] --- axis2-wsdl2code-maven-plugin:1.5.6:wsdl2code (default) @ crypto ---
Retrieving document at 'src/main/wsdl/SafeNetTokenizer.wsdl'.
[INFO] 
[INFO] --- build-helper-maven-plugin:1.8:add-source (add-source) @ crypto ---
[INFO] Source directory: /Users/david/workspace/KeyManagment-trunk/target/generated-sources added.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ crypto ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/david/workspace/KeyManagment-trunk/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ crypto ---
[INFO] Compiling 13 source files to /Users/david/workspace/KeyManagment-trunk/target/classes
[INFO] 
[INFO] --- findbugs-maven-plugin:2.5.2:findbugs (default) @ crypto ---
[INFO] Fork Value is true
    [java] The following classes needed for analysis were missing:
    [java]   com.ingrian.internal.ilc.IngrianLogger
    [java]   com.ingrian.security.nae.NAESession
    [java]   com.ingrian.internal.config.Config
    [java]   com.ingrian.security.nae.NAEKey
    [java]   com.ingrian.security.nae.HmacSHA256
    [java]   com.ingrian.internal.xml.XMLException
    [java]   com.ingrian.security.nae.NAEAESCipher
    [java]   com.ingrian.security.nae.IngrianProvider
    [java] Warnings generated: 310
    [java] Missing classes: 8
[INFO] Done FindBugs Analysis....
[INFO] 
[INFO] --- maven-bundle-plugin:2.3.7:manifest (bundle-manifest) @ crypto ---
[INFO] 
[INFO] <<< maven-javadoc-plugin:2.9.1:test-aggregate (report:test-aggregate) @ crypto <<<
[INFO] 
[INFO] >>> maven-javadoc-plugin:2.9.1:javadoc (report:javadoc) @ crypto >>>
[INFO] 
[INFO] --- axis2-wsdl2code-maven-plugin:1.5.6:wsdl2code (default) @ crypto ---
Retrieving document at 'src/main/wsdl/SafeNetTokenizer.wsdl'.
[INFO] 
[INFO] --- build-helper-maven-plugin:1.8:add-source (add-source) @ crypto ---
[INFO] Source directory: /Users/david/workspace/KeyManagment-trunk/target/generated-sources added.
[INFO] 
[INFO] <<< maven-javadoc-plugin:2.9.1:javadoc (report:javadoc) @ crypto <<<
[INFO] 
[INFO] >>> maven-javadoc-plugin:2.9.1:test-javadoc (report:test-javadoc) @ crypto >>>
[INFO] 
[INFO] --- axis2-wsdl2code-maven-plugin:1.5.6:wsdl2code (default) @ crypto ---
Retrieving document at 'src/main/wsdl/SafeNetTokenizer.wsdl'.
[INFO] 
[INFO] --- build-helper-maven-plugin:1.8:add-source (add-source) @ crypto ---
[INFO] Source directory: /Users/david/workspace/KeyManagment-trunk/target/generated-sources added.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ crypto ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/david/workspace/KeyManagment-trunk/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ crypto ---
[INFO] Compiling 2 source files to /Users/david/workspace/KeyManagment-trunk/target/classes
[INFO] 
[INFO] --- findbugs-maven-plugin:2.5.2:findbugs (default) @ crypto ---
[INFO] Fork Value is true
    [java] The following classes needed for analysis were missing:
    [java]   com.ingrian.internal.ilc.IngrianLogger
    [java]   com.ingrian.security.nae.NAESession
    [java]   com.ingrian.internal.config.Config
    [java]   com.ingrian.security.nae.NAEKey
    [java]   com.ingrian.security.nae.HmacSHA256
    [java]   com.ingrian.internal.xml.XMLException
    [java]   com.ingrian.security.nae.NAEAESCipher
    [java]   com.ingrian.security.nae.IngrianProvider
    [java] Warnings generated: 310
    [java] Missing classes: 8
[INFO] Done FindBugs Analysis....
[INFO] 
[INFO] --- maven-bundle-plugin:2.3.7:manifest (bundle-manifest) @ crypto ---
[INFO] 
[INFO] <<< maven-javadoc-plugin:2.9.1:test-javadoc (report:test-javadoc) @ crypto <<<
[WARNING] No project URL defined - decoration links will not be relativized!
[INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
[INFO] Skipped "JavaDocs" report, file "apidocs/index.html" already exists for the English version.
[INFO] Skipped "Test JavaDocs" report, file "testapidocs/index.html" already exists for the English version.
[INFO] Generating "About" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Plugin Management" report    --- maven-project-info-reports-plugin:2.7
...
[INFO] Generating "Project Team" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Project Summary" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Dependencies" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "CPD Report" report    --- maven-pmd-plugin:3.0.1
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] Generating "PMD Report" report    --- maven-pmd-plugin:3.0.1
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] Generating "JavaDocs" report    --- maven-javadoc-plugin:2.9.1
[INFO] 
Loading source files for package com.ihotelier.crypto...
Loading source files for package com.safenet.tokenization.wsclient...
Constructing Javadoc information...
Standard Doclet version 1.7.0_13
Building tree for all the packages and classes...
Generating ...
4 warnings
[WARNING] Javadoc Warnings
[WARNING] ...
[INFO] Fixed Javadoc frame injection vulnerability (CVE-2013-1571) in 1 files.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:30.831s
[INFO] Finished at: Tue Nov 05 14:02:04 EST 2013
[INFO] Final Memory: 40M/115M
[INFO] ------------------------------------------------------------------------

我看到在執行開始時在maven-site-plugin配置了findbugs。 我看到運行maven-compiler-plugin后,Findbugs正在執行(兩次!)。 (我可能將目標更改為流程類,以防止這種雙重執行。我看到8個錯誤,但我們實際上並沒有使用那些類。(我需要弄清楚如何跳過這些類)。

在構建即將結束時,我看到正在生成PMD和CPD報告( Generating "CPD Report" report ),但未生成Findbugs。

查看構建結果時,看到的是target/findbugs.xmltarget/findbugsXML.xml ,但在target/site下什么也沒有。

對不起,輸出過多。 我想確保我沒有跳過任何重要的事情。

向您展示我對Maven的了解。 我發現了兩件事:

  • 正在運行的site不會執行package (盡管compile會運行-可能是因為某些報告需要它)。
  • 除非首先完成該程序包,否則Findbugs無法生成站點報告。

我將findbugs插件移到了package階段,因此它不會運行兩次,現在一切似乎都很好。

我認為這與surefire報告問題類似,因此請嘗試將站點插件添加到<pluginManagement>部分:

<pluginManagement>
   <plugins>
     <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.3</version>
     </plugin>
   </plugins>
</pluginManagement>

暫無
暫無

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

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