Uploaded image for project: 'Maven Checkstyle Plugin'
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-318

Checkstyle plugin ignores sourceDirectories configuration.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 2.17
    • None
    • checkstyle:check
    • None

    Description

      I have a project on GitHub, that builds on Travis CI. It was running more or less fine until today. I updated configuration and now it uses different paths. I integrated Delombok with my build and right now:

      • Delombok processes src/main/java into target/generated-sources/delombok;
      • target/generated-sources/delombok is set as project source directory, so most of the other plugins operate on it;
      • but I want Checkstyle to only check my source code, not the generated one so I configured it to still process just src/main/java.

      It works locally, works on my Jenkins, but fails on Travis.

      This is the link to build that failed with debug flag turned on: https://travis-ci.org/chilloutdevelopment/pl.chilldev.commons/builds/123777140

      I attached dump of help:effective-pom and log of running mvn -X checkstyle:check (the initial part of it, which points the problem).

      To point it more preceisly - here is the part of the configuration loading:

      [DEBUG] -----------------------------------------------------------------------
      [DEBUG] Goal:
      org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (default)
      [DEBUG] Style:         Regular
      [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
      <configuration>
      ### skipped ###
        <propertyExpansion>checkstyle.project.basedir=/home/travis/build/chilloutdevelopment/pl.chilldev.commons</propertyExpansion>
      ### skipped ###
        <sourceDirectories default-value="${project.compileSourceRoots}">
          <sourceDirectory>src/main/java</sourceDirectory>
        </sourceDirectories>
      

      And this is the log from plugin execution:

      [DEBUG] Configuring mojo
      org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check from
      plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-checkstyle-plugin:2.17,
      parent: sun.misc.Launcher$AppClassLoader@5c647e05]
      [DEBUG] Configuring mojo
      'org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check' with
      basic configurator -->
      ### skipped ###
      [DEBUG]   (f) propertyExpansion =
      checkstyle.project.basedir=/home/travis/build/chilloutdevelopment/pl.chilldev.commons
      ### skipped ###
      [DEBUG]   (f) sourceDirectories =
      [/home/travis/build/chilloutdevelopment/pl.chilldev.commons/target/generated-sources/delombok]
      

      propertyExpansion and sourceDirectories - these are the two options set by my configuration - while propertyExpansion stays correct, sourceDirectories turns back to default value.

      Have no clue - what more can I include to help debugging this?

      Attachments

        1. mvn.log
          28 kB
          Rafał Wrzeszcz
        2. efective-pom.xml
          52 kB
          Rafał Wrzeszcz

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rafal.wrzeszcz@wrzasq.pl Rafał Wrzeszcz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: