Maven Checkstyle Plugin
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-31

Multi-module reports do not support custom classpath configurations

    Details

    • Type: Bug Bug
    • Status: Reopened Reopened
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.0-beta-1
    • Fix Version/s: None
    • Labels:
    • Number of attachments :
      0

      Description

      The latest multi-module tip shows the following:

      <reporting>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-checkstyle-plugin</artifactId>
              <configuration>
                <configLocation>whizbang/checkstyle.xml</configLocation>
                <headerLocation>whizbang/LICENSE.txt</headerLocation>
              </configuration>
              <dependencies>
                <dependency>
                  <groupId>com.example.whizbang</groupId>
                  <artifactId>build-tools</artifactId>
                  <version>1.0</version>
                </dependency>
              </dependencies>
            </plugin>
          </plugins>
        </reporting>
      

      This is invalid according to the latest 2.0.2 POM schema. <dependencies> is not supported in reporting plugins.

      So it seems impossible to provide a custom config in a multi-module build without using a network URL as we cannot use File or classpath.

        Issue Links

          Activity

          Hide
          fabrizio giustina added a comment -

          documentation issue, pom snippet fixed in svn

          Show
          fabrizio giustina added a comment - documentation issue, pom snippet fixed in svn
          Hide
          fabrizio giustina added a comment -

          reopen: configuring the dependency as a project-wide dependency works but it's not what we want.
          Configuring the build-tools dependency as a plugin dependency doesn't work either if the checkstyle plugin is called as a report, neither if it's called using checkstyle:check directly, see MCHECKSTYLE-27

          Show
          fabrizio giustina added a comment - reopen: configuring the dependency as a project-wide dependency works but it's not what we want. Configuring the build-tools dependency as a plugin dependency doesn't work either if the checkstyle plugin is called as a report, neither if it's called using checkstyle:check directly, see MCHECKSTYLE-27
          Hide
          Brett Porter added a comment -

          requires a Maven fix

          Show
          Brett Porter added a comment - requires a Maven fix
          Hide
          John Allen added a comment -

          Until core gets reporting sorted (ie. reportingManagement, dependencies for reports, etc) we define the checkstyle, clover-2.0 and pmd plugins as <build> plugins and specify their dependencies in the nornmal plugin way. Fortunately they dont have default goals bound to the lifecycle so don't do any harm in the normal biuld but when the report or check mojos are invoked either by site or via explicit invocation the plugin configuration seems to inherit the <build> defined configuration, including its dependencies.

          Show
          John Allen added a comment - Until core gets reporting sorted (ie. reportingManagement, dependencies for reports, etc) we define the checkstyle, clover-2.0 and pmd plugins as <build> plugins and specify their dependencies in the nornmal plugin way. Fortunately they dont have default goals bound to the lifecycle so don't do any harm in the normal biuld but when the report or check mojos are invoked either by site or via explicit invocation the plugin configuration seems to inherit the <build> defined configuration, including its dependencies.
          Hide
          Christian Goetze added a comment -

          I've been trying to get this to work for some time, and I can't seem to get there...

          So I did move the plugin configuration into the <build /> section, which at least caused the cyclic dependency error I saw before (when I used <extensions /> to go away, but now it seems that it won't go more than one level deep, skipping over module directories that do not contain a src subtree.

          INFO] ----------------------------------------------------------------------------
          [INFO] Building SenSage shared artifacts
          [INFO] task-segment: [checkstyle:check]
          [INFO] ----------------------------------------------------------------------------
          [INFO] Preparing checkstyle:check
          [INFO] [checkstyle:checkstyle]
          [INFO] Source directory does not exist - skipping report.
          [INFO] [checkstyle:check]
          [INFO] Unable to perform checkstyle:check, unable to find checkstyle:checkstyle outputFile.

          This is using maven 2.0.5

          Show
          Christian Goetze added a comment - I've been trying to get this to work for some time, and I can't seem to get there... So I did move the plugin configuration into the <build /> section, which at least caused the cyclic dependency error I saw before (when I used <extensions /> to go away, but now it seems that it won't go more than one level deep, skipping over module directories that do not contain a src subtree. INFO] ---------------------------------------------------------------------------- [INFO] Building SenSage shared artifacts [INFO] task-segment: [checkstyle:check] [INFO] ---------------------------------------------------------------------------- [INFO] Preparing checkstyle:check [INFO] [checkstyle:checkstyle] [INFO] Source directory does not exist - skipping report. [INFO] [checkstyle:check] [INFO] Unable to perform checkstyle:check, unable to find checkstyle:checkstyle outputFile. This is using maven 2.0.5

            People

            • Assignee:
              fabrizio giustina
              Reporter:
              Mike Perham
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: