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

Resources retrieval ignores resources definition in <build>

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.11
    • 2.13
    • None
    • None

    Description

      Consider this snippet from a POM:

      <build>
        <resources>
          <resource>
            <directory>src/main/resources</directory>
          </resource>
          <resource>
            <directory>${basedir}</directory>
            <targetPath>META-INF</targetPath>
            <includes>
              <include>LICENSE.txt</include>
            </includes>
          </resource>
        </resources>
      </build>
      

      So, the plugin should check everything in src/main/resources and the LICENSE.txt, after applying plugin's resource includes only properties files remain. Unfortunately, all files (in this case properties) below basedir, including those in target are checked because the plugin ignores the includes/excludes in that Resource element.

      The Resource element looks like this:

      Resource {targetPath: META-INF, filtering: false, FileSet {directory: D:\workspace-4.2\michael-o-tomcat-extras, PatternSet [includes: {LICENSE.txt}, excludes: {}]}}
      

      This happens in DefaultCheckstyleExecutor in lines 578 to 584. The outcome is that given properties files are checked twice and generated files are checked to.

      We need a resembling logic like in the maven-resources-plugin.

      Attachments

        Activity

          People

            rfscholte Robert Scholte
            michael-o Michael Osipov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: