Preventing checkstyle run in a specific maven submodule

I would like to define the start of checkstyle in the pom file and run it on all submodules except some specific ones.

In other words, I need some kind of <excludes> (which exists, but applies to file names), but which is for modules. Anyone any idea?

+42
java maven checkstyle
Nov 17 '12 at 11:33
source share
2 answers

Put in projects for which you want checkstyle to be disabled for:

 <project> ... <properties> ... <checkstyle.skip>true</checkstyle.skip> ... </properties> ... </project> 

Checkstyle will still work, but will do no-op ...

That is, if you do not redefine the default binding parameter maven-checkstyle-plugin skip , in this case you can achieve the same effect using in a specific project

 <project> ... <build> ... <plugins> ... <plugin> <artifactId>maven-checkstyle-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> ... </plugins> ... </build> ... </project> 

If you, of course, have not redefined the skip parameter in execution ... but if you know what it is, you also know the solution and will not ask this question :-)

+55
Nov 17 '12 at 20:58
source share

If you do not want to change your pom.xml, you can set the skip parameter to true from the command line using the -D option. This has been mentioned above as an "overridden skip parameter within execution." This is very similar to -Dmaven.test.skip = true use.

 mvn site -Dcheckstyle.skip=true 
+92
Dec 13 '12 at 10:57
source share



All Articles