欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

maven插件 pmd、checkstyle、findbugs、cobertura 、N'SIQ 忽略检查

程序员文章站 2022-05-24 22:10:04
...

maven插件的忽略配置

1.CheckStyle

 

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>2.7</version>
				<configuration>
					<excludes>**/tempuri/**/*</excludes>
				<configLocation>hy_checks.xml</configLocation>
				</configuration>
			</plugin>

 2.Pmd

 

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-pmd-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<excludes>
						<exclude>**/tempuri/**/*</exclude>
					</excludes>
				</configuration>
			</plugin>

 3.Findbugs

       <plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>findbugs-maven-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<xmlOutput>true</xmlOutput>
			             <findbugsXmlOutput>true</findbugsXmlOutput>
					<excludeFilterFile>findbugs-exclude-filter.xml</excludeFilterFile>
				</configuration>
	</plugin>
 

 4.cobertura 

<plugin>
	<groupId>org.codehaus.mojo</groupId>
	<artifactId>cobertura-maven-plugin</artifactId>
	<version>2.5.1</version>
	<configuration>
		<check>
			<branchRate>70</branchRate>
			<lineRate>70</lineRate>
			<haltOnFailure>true</haltOnFailure>
			<totalBranchRate>70</totalBranchRate>
			<totalLineRate>70</totalLineRate>
			<packageLineRate>100</packageLineRate>
			<packageBranchRate>100</packageBranchRate>
			<regexes>
				<regex>
					<pattern>cn.com.xx.xx.*</pattern>
					<branchRate>60</branchRate>
					<lineRate>70</lineRate>
				</regex>
			</regexes>
		</check>
		<instrumentation>
			<ignores>
				<ignore>org.tempuri.*</ignore>
			</ignores>
			<excludes>
				<exclude>org/tempuri/*.class</exclude>
			</excludes>
		</instrumentation>
		<formats>
			<format>xml</format>
		</formats>
	</configuration>
</plugin>
 

 5.N'SIQ 

 

解决办法: 
1.新建一个xxxx.txt文件(文件名随意),内容格式为: -src/main/java/cn/com/XX/XX/XX/dmgczb 表示这个包下的文件都忽略检查。 
2.在hudson项目N'SIQ Collector设置FileFilter.txt Location 中选择这个xxxx.txt文件,然后重新构建