maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manfred Moser" <manf...@mosabuam.com>
Subject Re: Maven build does not fail due to checkstyle errors
Date Tue, 29 Jul 2014 00:03:17 GMT
You either have to execute it manually with 

mvn checkstyle:check

or if you want it to run as part of a normal build you have to bind it to a lifecycle phase
in the config

 <executions>
                        <execution>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>

Also ... check out the setup on for reusing the config file without having relative paths..


https://github.com/mosabua/ksoap2-android/blob/master/pom.xml

hth

manfred

ecthelion wrote on 28.07.2014 16:07:

> 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.
> 
> 
> 
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Maven-build-does-not-fail-due-to-checkstyle-errors-tp5801275.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message