Uploaded image for project: 'Maven Assembly Plugin'
  1. Maven Assembly Plugin
  2. MASSEMBLY-180

A bug in artifact filtering ( maven-common-artifact-filters )

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2
    • 2.2-beta-2
    • None
    • None

    Description

      I found this bug while using <includes> and <excludes> section in <dependencySet> element.
      I had to check the source code to understand the "Advanced Artifact-Matching in includes and excludes".
      I found a bug in the project maven-common-artifact-filters, 1.0-alpha-1.
      I checked the class PatternIncludesArtifactFilter, revision 487820.
      There is a bug in the method:
      private boolean matchAgainst( String value, List patterns, boolean regionMatch )
      There is an iteration of a list of patterns. When a pattern matches, the method should return true.
      When no pattern matches, it should return false.
      However, when there is a pattern using a wildcard and this pattern does not match, the flow
      will reach the line 216 where the method returns false.
      Gotcha! the next patterns are not tried....
      In other words, say we have :
      <dependencySet>
      ...
      <exclusions>
      <exclusion>:jar:</exclusion>
      </exclusion>:test-jar:</exclusion>
      </exclusions>
      ...
      </dependencySet>
      The effect of the bug is that the seconds pattern (:test-jar will not be used, because if matching of the first (:jar fails,
      the method returns false, the next patterns is not used.
      I hope I clarified this issue.

      Attachments

        Activity

          People

            jdcasey John Dennis Casey
            mvolauf Milos Volauf
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: