Domanda

When I use the maven-checkstyle-plugin it always performs checks on files in my src/main/resource folder. I've set the <excludes> directive in my pom file but it apparently has no effect. On the console I see:

[DEBUG]   (f) excludes = **/env/*,/**/env/*,**/resources,/**/resources,**/resources/*,**/resources/**/*,/**/resources/**/*
[DEBUG]   (f) includeTestSourceDirectory = false
[DEBUG]   (f) includes = **\/*.java 
[DEBUG]   (f) sourceDirectory = /opt/Whitney/workspace/XXX/src/main/java
[DEBUG]   (f) testSourceDirectory = /opt/Whitney/workspace/XXX/src/test/java  
[DEBUG] -- end configuration --

[DEBUG] Added '/opt/Whitney/workspace/XXX/src/main/resources' as a source directory.

This trace suggests that it is ignoring my exclusion directive. Additionally, properties files are being checked by checkstyle even though my <includes> directive mandates **\/*.java

How can I prevent checkstyle from looking within my resources folder?

È stato utile?

Soluzione

This is a known issue with the 2.10 version of the maven-checkstyle plugin. See the comments here:

https://jira.codehaus.org/browse/MCHECKSTYLE-184

You can either downgrade to version 2.9.1 or wait until they fix the configuration of this in a newer version.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top