Upgrading Checkstyle at Runtime

Maven Checkstyle plugin comes with a default Checkstyle version: for maven-checkstyle-plugin 3.6.0, Checkstyle 9.3 is used by default.

Given Checkstyle generally keeps good compatibility between versions, you can override the version used at runtime to benefit from Checkstyle latest bugfixes:

  1. <project>
  2. ...
  3. <build>
  4. <pluginManagement>
  5. <plugins>
  6. <plugin>
  7. <groupId>org.apache.maven.plugins</groupId>
  8. <artifactId>maven-checkstyle-plugin</artifactId>
  9. <version>3.6.0</version>
  10. <dependencies>
  11. <dependency>
  12. <groupId>com.puppycrawl.tools</groupId>
  13. <artifactId>checkstyle</artifactId>
  14. <version>...choose your version...</version>
  15. </dependency>
  16. </dependencies>
  17. </plugin>
  18. </plugins>
  19. </pluginManagement>
  20. </build>
  21. ...
  22. </project>