Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable maven checkstyle

I want to execute a maven target but checkstyle errors forbids that. I have no time right now to correct checkstyle error (my checkstyle rules have been recently updated and I can't handle all of them right now).

Is there a way to disable checkstyle operation and execute my goal anyway ?

like image 207
RandomCoder Avatar asked Aug 31 '15 09:08

RandomCoder


People also ask

How do I turn off Checkstyle?

Then to disable Checkstyle, you use //CHECKSTYLE:OFF and //CHECKSTYLE:ON (default values) in your code.

How do I disable Checkstyle Pom?

If you want to disable checkstyle from your pom, you can add the checkstyle plugin to the pom and set the skip flag to prevent the check.

How do I turn off Checkstyle in eclipse?

In latest eclipse version(9/2014) we have to visit Help -> Eclipse Market and go to installed tab. Then select uninstall. After uninstallation this will ask for a eclipse restart. And that is it.


2 Answers

Solution is : mvn [target] -Dcheckstyle.skip.

I like this solution as it is temporary and do not require editing of pom files, or anything that can be versioned.

like image 128
RandomCoder Avatar answered Nov 08 '22 23:11

RandomCoder


RandomCoders answer is the preferred one.

If you want to disable checkstyle from your pom, you can add the checkstyle plugin to the pom and set the skip flag to prevent the check.

<plugin>     <groupId>org.apache.maven.plugins</groupId>     <artifactId>maven-checkstyle-plugin</artifactId>     <configuration>         <skip>true</skip>     </configuration> </plugin> 
like image 34
Sven Döring Avatar answered Nov 08 '22 23:11

Sven Döring