Maven Assembly Plugin
  1. Maven Assembly Plugin
  2. MASSEMBLY-180

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

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2-beta-2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      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.

        Activity

        Hide
        John Casey added a comment -

        fixed in revId=590694

        Show
        John Casey added a comment - fixed in revId=590694

          People

          • Assignee:
            John Casey
            Reporter:
            Milos Volauf
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: