You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Erling Johan Andersen (JIRA)" <ji...@apache.org> on 2016/07/01 12:18:11 UTC

[jira] [Comment Edited] (MDEP-501) Filtering dependencies does not retain the order of the unfiltered list

    [ https://issues.apache.org/jira/browse/MDEP-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15358875#comment-15358875 ] 

Erling Johan Andersen edited comment on MDEP-501 at 7/1/16 12:17 PM:
---------------------------------------------------------------------

Adding a patch that fixes the ordering issue for both filtering and classifier translation, and includes some test cases. No changes are needed in the common artifact filters project.


was (Author: erling.johan.andersen@gmail.com):
The attached patch fixes the ordering issue for both filtering and classifier translation, and includes some test cases. No changes are needed in the common artifact filters project.

> Filtering dependencies does not retain the order of the unfiltered list
> -----------------------------------------------------------------------
>
>                 Key: MDEP-501
>                 URL: https://issues.apache.org/jira/browse/MDEP-501
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>    Affects Versions: 2.10
>            Reporter: Beirtí Ó'Nunáin
>         Attachments: build-classpath-preserve-order.patch
>
>
> If you use the build-classpath mojo, you get the dependency list as specified in the pom. However, if you introduce filtering, you end up losing the dependency order. It seems that the org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter declares 'Set' instead of 'SortedSet' and that the org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter returns a HashSet instead of a LinkedHashSet, even though a LinkedHashSet is being passed in.
> The impact of this is that you cannot generate a correctly-ordered classpath when using filters. The fix is very straightforward, simply change the filterIncludes and filterExcludes methods of AbstractArtifactFeatureFilter to use a LinkedHashSet.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)