Quantcast
Viewing all articles
Browse latest Browse all 5648

Maven build does not fail due to checkstyle errors

I configured Maven to use the checkstyle plugin.

Here is what I have in pom.xml's build section :

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<consoleOutput>true</consoleOutput>
<logViolationsToConsole>true</logViolationsToConsole>
<failOnViolation>true</failOnViolation>
<configLocation>${basedir}/.../checkstyle-config.xml
</configLocation>
</configuration>
</plugin>

I am getting checkstyle errors in Eclipse using the same configuration file
but Maven build does not fail. It builds the project successfully.

I am trying to stop the maven build if there is a checkstyle issue with the
code.

Is there something I am missing?

Thanks.

Viewing all articles
Browse latest Browse all 5648

Trending Articles