jenkins+maven配置Checkstyle+FindBugs+PMD

注意點:
1.不要用maven 3.5 去構(gòu)建否則構(gòu)建總會報java.io.EOFException異常。(切記,可換其他版本去構(gòu)建我換了3.1.1)

報java.io.EOFException異常

2.要在pom.xml文件中增加Checkstyle,F(xiàn)indBugs,PMD這三個插件

pom文件修改如下:

<reporting>
        <plugins>
               <plugin>
                      <groupId>org.codehaus.mojo</groupId>
                      <artifactId>findbugs-maven-plugin</artifactId>
                      <version>3.0.1</version>
                      <configuration>
                      <xmlOutput>true</xmlOutput>
                      <!-- Optional directoryto put findbugs xdoc xml report -->
                      <!-- <xmlOutputDirectory>target/site</xmlOutputDirectory>-->
                      <findbugsXmlOutput>true</findbugsXmlOutput>
                      <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
                      </configuration>
               </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>3.8</version>
                </plugin>
                <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-checkstyle-plugin</artifactId>
                  <version>2.17</version>
                  <reportSets>
                    <reportSet>
                      <reports>
                        <report>checkstyle</report>
                      </reports>
                    </reportSet>
                  </reportSets>
                </plugin>
        </plugins>
</reporting>

jenkins項目配置如下:
構(gòu)建命令:

compile -D maven.test.skip=true clean compile findbugs:findbugs checkstyle:checkstyle pmd:pmd

最終效果圖:

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容