Class CheckstyleChecker

All Implemented Interfaces:
Generator, Renamable, ResourceProvider

A Generator that runs checkstyle on the project's Java sources.

The checkstyle configuration is loaded from a file named checkstyle.xml. First, the project's directory is searched. If not found, the search continues in the parent project's directory and so on, up to the root project. The configuration path can also be set explicitly with config(java.nio.file.Path).

Each style violation is printed to [context().error()]. The resulting CheckstyleResult contains summary counts. When errors are found, the result is flagged as faulty unless ignoreFailed was invoked.

This provider is made available as an extension. org.jdrupes:jdbld-ext-pmd:

  • Constructor Details

    • CheckstyleChecker

      public CheckstyleChecker(Project project)
      Initializes a new style checker.
      Parameters:
      project - the project
  • Method Details