jenkins+maven配置Checkstyle+FindBugs+PMD

注意点:
1.不要用maven 3.5 去构建否则构建总会报java.io.EOFException异常。(切记,可换其他版本去构建我换了3.1.1)

报java.io.EOFException异常

2.要在pom.xml文件中增加Checkstyle,FindBugs,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项目配置如下:
构建命令:

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

最终效果图:

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容