Affects Version/s: 2.2
Fix Version/s: 2.2-beta-2
Number of attachments :
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 :
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.