Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-1300

Order of dependencies is not always retained when filtering

    XMLWordPrintableJSON

Details

    Description

      AbstractArtifactFeatureFilter does not retain the order of dependencies when filtering using multiple includes. The dependencies will be ordered first by their respective includes.

      For instance when filtering the following set of dependencies using org.apache.maven.shared.artifact.filter.collection.TypeFilter

      com.example:dependency-a:jar:1.0
      com.example:dependency-b:war:1.0
      com.example:dependency-c:zip:1.0
      

      with includes zip,jar and excludes war, I will get the following:

      com.example:dependency-c:zip:1.0
      com.example:dependency-a:jar:1.0
      

      where dependencies are ordered by their type according to the the includes. I would expect that the filter retains the original order of dependencies, irrespective of the order of includes, i.e.

      com.example:dependency-a:jar:1.0
      com.example:dependency-c:zip:1.0
      

      This is caused by an invalid order of loops in org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter#filterIncludes, where includes are traversed first instead of artifacts.

      Attachments

        Issue Links

          Activity

            People

              elharo Elliotte Rusty Harold
              kjarosh Kamil Jarosz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: