maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Scholte (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MNG-6415) Project Artifacts Cache does not retain the order of classpath entries.
Date Tue, 22 May 2018 21:22:00 GMT

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

Robert Scholte commented on MNG-6415:
-------------------------------------

With Maven the dependency resolution defines the order, there's no such thing as wildcards,
the order is always predictable. Depending on the way the application is created it is possible
to respect the order. With MNG-6025 that order changed. 
I do understand the claim from Thomas, especially when referring to a directory instead of
explicit jars, if you know that [File.html#listFiles()|https://docs.oracle.com/javase/7/docs/api/java/io/File.html#listFiles()]
says 
{quote}There is no guarantee that the name strings in the resulting array will appear in any
specific order; they are not, in particular, guaranteed to appear in alphabetical order.{quote}
Maven is a different story, it should not change the order if applications relies on that
(on purpose and on their own risk). Otherwise we should add an option to randomize the order
of the classpath.

> Project Artifacts Cache does not retain the order of classpath entries.
> -----------------------------------------------------------------------
>
>                 Key: MNG-6415
>                 URL: https://issues.apache.org/jira/browse/MNG-6415
>             Project: Maven
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.2
>         Environment: Windows 7, JDK8u144
>            Reporter: Seckin Onur SELAMET
>            Priority: Major
>              Labels: CLASSPATH
>         Attachments: [MNG-6415]_Fixes_Project_Artifact_Cache_classpath_order_retaining_issue_.patch
>
>
> Project artifacts cache does not retain the order of classpath entries.
> Wrong Object type used in implementation. HashSet can not guarantee the order of elements.
> In runtime ProjectArtifacts passed as LinkedHashSet already which is safe.
>  
> Possible fix is provided in comments section.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message