Add checkstyle to Travis CI (closes #254)

Currently, checkstyle is only run as part of the reporting phase, and
it's up to the developer to check the report manually.

This patch adds the checkstyle configuration to the build plugins so
it can be used to check the code (as opposed to just generate a
report of the failures) and adds it to Travis CI's configuration so
every new patch will be automatically checked against it.
This commit is contained in:
Allon Mureinik 2017-03-11 11:14:16 +02:00 committed by pascalschumacher
parent 754e669f76
commit 4fb393be2c
2 changed files with 11 additions and 2 deletions

View File

@ -22,7 +22,7 @@ jdk:
- oraclejdk8
script:
- mvn test javadoc:javadoc -B
- mvn test checkstyle:check javadoc:javadoc -B
after_success:
- mvn clean apache-rat:check cobertura:cobertura coveralls:report

11
pom.xml
View File

@ -576,6 +576,7 @@
<!-- Override clirr version to be able to build the site on Java 8 -->
<commons.clirr.version>2.8</commons.clirr.version>
<checkstyle.plugin.version>2.17</checkstyle.plugin.version>
</properties>
@ -646,6 +647,14 @@
</ignorePathsToDelete>
</configuration>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.plugin.version}</version>
<configuration>
<configLocation>${basedir}/checkstyle.xml</configLocation>
<enableRulesSummary>false</enableRulesSummary>
</configuration>
</plugin>
</plugins>
</build>
@ -654,7 +663,7 @@
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<version>${checkstyle.plugin.version}</version>
<configuration>
<configLocation>${basedir}/checkstyle.xml</configLocation>
<enableRulesSummary>false</enableRulesSummary>