0

I'm running a maven project using Jenkins. The project is using the checkstyle plugin to verify the java code and fail the build if errors are found. I've added the plugin to my parent pom file and added it to the "validate" phase. When running "mvn validate" from command line on that POM, the "checkstyle" plugin runs and checks the code. When running from Jenkins, the checkstyle plugin doesn't run. Here is the parent pom build tag:

<build>
<plugins>
    <plugin>
        <executions>
            <execution>
                <goals>
                    <goal>check</goal>
                </goals>
                <phase>validate</phase>
            </execution>
        </executions>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.9.1</version>
        <configuration>
            <configLocation>http://10.2.3.4/CheckStyle/checkstyle.xml</configLocation>
            <failsOnError>true</failsOnError>
        </configuration>
    </plugin>
</plugins>

How can I make Jenkins not to ignore the build tag so it will run the checkstyle plugin in the validate phase? Thanks!

Omri
  • 1,058
  • 3
  • 14
  • 26

1 Answers1

0

Sorry. There was a weird source control issue which caused an older version of my pom to run. The code above works perfectly with Jenkins as well.

Omri
  • 1,058
  • 3
  • 14
  • 26