标签:ati cee jenkin 1.0 car epo mave org findbugs
一、新增一个自由风格的项目
建好之后如下图所示
二、修改pom.xml文件
在项目根目录下添加如下代码(此处添加的3个插件)
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.15</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<failsOnError>false</failsOnError>
<linkXRef>false</linkXRef>
</configuration>
<!-- <dependencies>
<dependency>
<groupId>com.example.build-tools</groupId>
<artifactId>build-tools</artifactId>
<version>1.0</version>
</dependency>
</dependencies>-->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.6</version>
<configuration>
<linkXref>true</linkXref>
<sourceEncoding>utf-8</sourceEncoding>
<rulesets>
<ruleset>pmd.xml</ruleset>
</rulesets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.3</version>
<configuration>
<xmlOutput>true</xmlOutput>
<findbugsXmlOutput>true</findbugsXmlOutput>
<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
<!--<xmlOutputDIrectory>target/site</xmlOutputDirectory>-->
<!--<excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
<includeFilterFile>findbugs-include.xml</includeFilterFile>-->
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
</plugins>
</reporting>
<!-- <modules>
<module>build-tools</module>
<module>toycar-poss-manage</module>
</modules> -->
</project> <!--在这一层添加-->
修改完pom.xml后还需要添加自定义的checkstyle.xml 和pmd.xml 和findbugs.xml
注意:需要注意的是 如果项目为聚合项目则需要在每个子项目中都添加checkstyle.xml 和pmd.xml 和findbugs.xml
标签:ati cee jenkin 1.0 car epo mave org findbugs
原文地址:https://www.cnblogs.com/gcgc/p/5227016.html