In the last post I mention how to configure your Maven Webdriver project on Jenkins, today let's see how to configure checkStyle plugin for static analysis with jenkins.
pom.xml
Configure Check Style with Jenkins
follow the steps mention below to configure and generate checkStyle Report in jenkins
Install checkStyle plugin Navigate to Manage Jenkins->Manage Plugin and install checkStyle plugin and then restart the jenkins
Configure checkStyle for project
Following is how to configure checkStyle for Maven project, it might vary if you are using ANT.
Configure Check Style with Maven
Mention the following plugin in pom.xml, make sure you mention it inside build blockpom.xml
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.10</version> <configuration> <sourceDirectory>src</sourceDirectory> </configuration> </plugin>
Configure Check Style with Jenkins
follow the steps mention below to configure and generate checkStyle Report in jenkins
Install checkStyle plugin Navigate to Manage Jenkins->Manage Plugin and install checkStyle plugin and then restart the jenkins
Configure checkStyle for project
Following is how to configure checkStyle for Maven project, it might vary if you are using ANT.
- Append checkstyle:checkstyle to your build goal
- check Publish Checkstyle analysis results
Configure checkStyle for Project
Now you need to configure which reports you want to see for this project, follow the steps to configure reports