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. Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/4fb393be Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/4fb393be Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/4fb393be Branch: refs/heads/release Commit: 4fb393be2c847d77b371a246e22704855a42201a Parents: 754e669 Author: Allon Mureinik <amure...@redhat.com> Authored: Sat Mar 11 11:14:16 2017 +0200 Committer: pascalschumacher <pascalschumac...@gmx.net> Committed: Sun Mar 12 17:57:23 2017 +0100 ---------------------------------------------------------------------- .travis.yml | 2 +- pom.xml | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/4fb393be/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml index 4e3fd53..44a34a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 http://git-wip-us.apache.org/repos/asf/commons-lang/blob/4fb393be/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index c4049c9..fc75181 100644 --- a/pom.xml +++ b/pom.xml @@ -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>