You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Max Bowsher (JIRA)" <ji...@codehaus.org> on 2007/07/05 15:54:13 UTC

[jira] Created: (MECLIPSE-294) Sort items in the generated .classpath

Sort items in the generated .classpath
--------------------------------------

                 Key: MECLIPSE-294
                 URL: http://jira.codehaus.org/browse/MECLIPSE-294
             Project: Maven 2.x Eclipse Plugin
          Issue Type: Improvement
    Affects Versions: 2.3
            Reporter: Max Bowsher
         Attachments: eclipse-sort.patch

Currently, the ordering of items on the generated .classpath is controlled by the JVM's HashSet ordering.

One effect of this is that the project-07 and project-33 tests are currently commented out, because it's impossible to write an expected/.classpath file that works everywhere.

More generally, it's bad that the classpath ordering can vary between platforms and JVM orderings.

Therefore, I think it would be a good idea to sort the classpath. This would be done by invoking Collections.sort in AbstractIdeSupportMojo.doDependencyResolution. IdeDependency already implements Comparable, on the basis of groupId+artifactId+type. Classifier should be added to the properties considered in compareTo.

Patch attached as described above.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MECLIPSE-294) Sort items in the generated .classpath

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MECLIPSE-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arnaud Heritier closed MECLIPSE-294.
------------------------------------

       Resolution: Duplicate
    Fix Version/s: 2.5

Dependencies are now sorted by artifactId instead to have a random sort.
It's only a wordaround, which could disappear in the feature if maven's core has a policy for dependencies order.

> Sort items in the generated .classpath
> --------------------------------------
>
>                 Key: MECLIPSE-294
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-294
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Max Bowsher
>            Assignee: Arnaud Heritier
>             Fix For: 2.5
>
>         Attachments: eclipse-sort.patch
>
>
> Currently, the ordering of items on the generated .classpath is controlled by the JVM's HashSet ordering.
> One effect of this is that the project-07 and project-33 tests are currently commented out, because it's impossible to write an expected/.classpath file that works everywhere.
> More generally, it's bad that the classpath ordering can vary between platforms and JVM orderings.
> Therefore, I think it would be a good idea to sort the classpath. This would be done by invoking Collections.sort in AbstractIdeSupportMojo.doDependencyResolution. IdeDependency already implements Comparable, on the basis of groupId+artifactId+type. Classifier should be added to the properties considered in compareTo.
> Patch attached as described above.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Reopened: (MECLIPSE-294) Sort items in the generated .classpath

Posted by "Max Bowsher (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MECLIPSE-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Max Bowsher reopened MECLIPSE-294:
----------------------------------


Reopening. Not a duplicate of MECLIPSE-152. Related, but the fix applied for that does not fix the issue here.

The MECLIPSE-152 fix sorts only by artifactId. A proper fix for this issue must define an ordering taking into account (groupId, artifactId, type, classifier) - i.e. all the components of a dependencyConflictId. There's no particular need for these 4 sort keys to be in any particular order, though, so this issue isn't in conflict with MECLIPSE-152, which requires that artifactId have a higher sort priority than groupId.

I propose that this issue should be fixed by extending the logic introduced for MECLIPSE-152 to sort not just on artifactId, but on artifactId+classifier+type+groupId in that order.

> Sort items in the generated .classpath
> --------------------------------------
>
>                 Key: MECLIPSE-294
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-294
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Max Bowsher
>            Assignee: Arnaud Heritier
>             Fix For: 2.5
>
>         Attachments: eclipse-sort.patch
>
>
> Currently, the ordering of items on the generated .classpath is controlled by the JVM's HashSet ordering.
> One effect of this is that the project-07 and project-33 tests are currently commented out, because it's impossible to write an expected/.classpath file that works everywhere.
> More generally, it's bad that the classpath ordering can vary between platforms and JVM orderings.
> Therefore, I think it would be a good idea to sort the classpath. This would be done by invoking Collections.sort in AbstractIdeSupportMojo.doDependencyResolution. IdeDependency already implements Comparable, on the basis of groupId+artifactId+type. Classifier should be added to the properties considered in compareTo.
> Patch attached as described above.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-294) Sort items in the generated .classpath

Posted by "Geoffrey Wiseman (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_112612 ] 

Geoffrey Wiseman commented on MECLIPSE-294:
-------------------------------------------

{quote}IMHO sorting is not a good solution either, although bad practice - sometimes two jars contain same classes and the order of the classpath defines which are used. It should simply keep the "declaration" order. Therefore internally any instance of HashMap should be replaced by one of a LinkedHashMap.{quote}

I'm not particularly concerned about the order -- just that there be consistency.  And if it's easier to just go with sorting, that's a step in the right direction.  In the long run, I agree there might be reasons for an order other than alphabetical, although there are reasonable arguments about why trying to get too fancy could delay the feature, which I don't want.  ;)

> Sort items in the generated .classpath
> --------------------------------------
>
>                 Key: MECLIPSE-294
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-294
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Max Bowsher
>         Attachments: eclipse-sort.patch
>
>
> Currently, the ordering of items on the generated .classpath is controlled by the JVM's HashSet ordering.
> One effect of this is that the project-07 and project-33 tests are currently commented out, because it's impossible to write an expected/.classpath file that works everywhere.
> More generally, it's bad that the classpath ordering can vary between platforms and JVM orderings.
> Therefore, I think it would be a good idea to sort the classpath. This would be done by invoking Collections.sort in AbstractIdeSupportMojo.doDependencyResolution. IdeDependency already implements Comparable, on the basis of groupId+artifactId+type. Classifier should be added to the properties considered in compareTo.
> Patch attached as described above.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-294) Sort items in the generated .classpath

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_112599 ] 

Arnaud Heritier commented on MECLIPSE-294:
------------------------------------------

Geoffrey, I just removed the "fixed for version' because I didn't have a look at it and there were approximatively 25 issues set for the 2.5. I'll review all issues before to release the eclipse plugin and I'll begin with the ones having a patch ....

> Sort items in the generated .classpath
> --------------------------------------
>
>                 Key: MECLIPSE-294
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-294
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Max Bowsher
>         Attachments: eclipse-sort.patch
>
>
> Currently, the ordering of items on the generated .classpath is controlled by the JVM's HashSet ordering.
> One effect of this is that the project-07 and project-33 tests are currently commented out, because it's impossible to write an expected/.classpath file that works everywhere.
> More generally, it's bad that the classpath ordering can vary between platforms and JVM orderings.
> Therefore, I think it would be a good idea to sort the classpath. This would be done by invoking Collections.sort in AbstractIdeSupportMojo.doDependencyResolution. IdeDependency already implements Comparable, on the basis of groupId+artifactId+type. Classifier should be added to the properties considered in compareTo.
> Patch attached as described above.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-294) Sort items in the generated .classpath

Posted by "Denis Cabasson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_102953 ] 

Denis Cabasson commented on MECLIPSE-294:
-----------------------------------------

Would definitly be a good idea and that shouldn't break anything.

> Sort items in the generated .classpath
> --------------------------------------
>
>                 Key: MECLIPSE-294
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-294
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Max Bowsher
>         Attachments: eclipse-sort.patch
>
>
> Currently, the ordering of items on the generated .classpath is controlled by the JVM's HashSet ordering.
> One effect of this is that the project-07 and project-33 tests are currently commented out, because it's impossible to write an expected/.classpath file that works everywhere.
> More generally, it's bad that the classpath ordering can vary between platforms and JVM orderings.
> Therefore, I think it would be a good idea to sort the classpath. This would be done by invoking Collections.sort in AbstractIdeSupportMojo.doDependencyResolution. IdeDependency already implements Comparable, on the basis of groupId+artifactId+type. Classifier should be added to the properties considered in compareTo.
> Patch attached as described above.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-294) Sort items in the generated .classpath

Posted by "Joerg Schaible (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_112566 ] 

Joerg Schaible commented on MECLIPSE-294:
-----------------------------------------

IMHO sorting is not a good solution either, although bad practice - sometimes two jars contain same classes and the order of the classpath defines which are used. It should simply keep the "declaration" order. Therefore internally any instance of HashMap should be replaced by one of a LinkedHashMap.

> Sort items in the generated .classpath
> --------------------------------------
>
>                 Key: MECLIPSE-294
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-294
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Max Bowsher
>         Attachments: eclipse-sort.patch
>
>
> Currently, the ordering of items on the generated .classpath is controlled by the JVM's HashSet ordering.
> One effect of this is that the project-07 and project-33 tests are currently commented out, because it's impossible to write an expected/.classpath file that works everywhere.
> More generally, it's bad that the classpath ordering can vary between platforms and JVM orderings.
> Therefore, I think it would be a good idea to sort the classpath. This would be done by invoking Collections.sort in AbstractIdeSupportMojo.doDependencyResolution. IdeDependency already implements Comparable, on the basis of groupId+artifactId+type. Classifier should be added to the properties considered in compareTo.
> Patch attached as described above.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Work started: (MECLIPSE-294) Sort items in the generated .classpath

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MECLIPSE-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on MECLIPSE-294 started by Arnaud Heritier.

> Sort items in the generated .classpath
> --------------------------------------
>
>                 Key: MECLIPSE-294
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-294
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Max Bowsher
>            Assignee: Arnaud Heritier
>             Fix For: 2.5
>
>         Attachments: eclipse-sort.patch
>
>
> Currently, the ordering of items on the generated .classpath is controlled by the JVM's HashSet ordering.
> One effect of this is that the project-07 and project-33 tests are currently commented out, because it's impossible to write an expected/.classpath file that works everywhere.
> More generally, it's bad that the classpath ordering can vary between platforms and JVM orderings.
> Therefore, I think it would be a good idea to sort the classpath. This would be done by invoking Collections.sort in AbstractIdeSupportMojo.doDependencyResolution. IdeDependency already implements Comparable, on the basis of groupId+artifactId+type. Classifier should be added to the properties considered in compareTo.
> Patch attached as described above.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-294) Sort items in the generated .classpath

Posted by "Geoffrey Wiseman (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_112559 ] 

Geoffrey Wiseman commented on MECLIPSE-294:
-------------------------------------------

This is a regular PITA for us; hard to know if the files are actually in conflict when they're constantly shifting in order any time you run mvn eclipse:eclipse.

> Sort items in the generated .classpath
> --------------------------------------
>
>                 Key: MECLIPSE-294
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-294
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Max Bowsher
>         Attachments: eclipse-sort.patch
>
>
> Currently, the ordering of items on the generated .classpath is controlled by the JVM's HashSet ordering.
> One effect of this is that the project-07 and project-33 tests are currently commented out, because it's impossible to write an expected/.classpath file that works everywhere.
> More generally, it's bad that the classpath ordering can vary between platforms and JVM orderings.
> Therefore, I think it would be a good idea to sort the classpath. This would be done by invoking Collections.sort in AbstractIdeSupportMojo.doDependencyResolution. IdeDependency already implements Comparable, on the basis of groupId+artifactId+type. Classifier should be added to the properties considered in compareTo.
> Patch attached as described above.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-294) Sort items in the generated .classpath

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_101359 ] 

Arnaud Heritier commented on MECLIPSE-294:
------------------------------------------

completly agree to apply. For tests projects we should consider to use XMLUnit to compare our files.

> Sort items in the generated .classpath
> --------------------------------------
>
>                 Key: MECLIPSE-294
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-294
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Max Bowsher
>         Attachments: eclipse-sort.patch
>
>
> Currently, the ordering of items on the generated .classpath is controlled by the JVM's HashSet ordering.
> One effect of this is that the project-07 and project-33 tests are currently commented out, because it's impossible to write an expected/.classpath file that works everywhere.
> More generally, it's bad that the classpath ordering can vary between platforms and JVM orderings.
> Therefore, I think it would be a good idea to sort the classpath. This would be done by invoking Collections.sort in AbstractIdeSupportMojo.doDependencyResolution. IdeDependency already implements Comparable, on the basis of groupId+artifactId+type. Classifier should be added to the properties considered in compareTo.
> Patch attached as described above.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MECLIPSE-294) Sort items in the generated .classpath

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MECLIPSE-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arnaud Heritier closed MECLIPSE-294.
------------------------------------

    Resolution: Fixed

Fixed. All test cases pass.

> Sort items in the generated .classpath
> --------------------------------------
>
>                 Key: MECLIPSE-294
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-294
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.3
>            Reporter: Max Bowsher
>            Assignee: Arnaud Heritier
>             Fix For: 2.5
>
>         Attachments: eclipse-sort.patch
>
>
> Currently, the ordering of items on the generated .classpath is controlled by the JVM's HashSet ordering.
> One effect of this is that the project-07 and project-33 tests are currently commented out, because it's impossible to write an expected/.classpath file that works everywhere.
> More generally, it's bad that the classpath ordering can vary between platforms and JVM orderings.
> Therefore, I think it would be a good idea to sort the classpath. This would be done by invoking Collections.sort in AbstractIdeSupportMojo.doDependencyResolution. IdeDependency already implements Comparable, on the basis of groupId+artifactId+type. Classifier should be added to the properties considered in compareTo.
> Patch attached as described above.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira