maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Noel Rouvignac (JIRA)" <>
Subject [jira] Updated: (MECLIPSE-388) Correct classpath ordering in .classpath
Date Wed, 05 Oct 2011 20:34:17 GMT


Jean-Noel Rouvignac updated MECLIPSE-388:

    Attachment: ideal.classpath

Hi Barrie,

Many thanks for your help on this issue.
I had a think about what would make sense as a .classpath file to me on this example. I based
myself on the dependency tree as it is the only way users can change how maven will order
the jars.
I reached the conclusion that a breadth-first  search, ordered by the position in the dependencies
is what I want. First of all you want to see your top level dependencies being included in
the classpath in the order they are declared, then come the second level dependencies also
following the order of the top level dependencies, etc.

So if you have the folowing dependencies:
   +- a
      +- a1
      +- a2
      +- a3
   +- b
      +- b1
      +- b2
      +- b3
   +- c
      +- c1
      +- c2
      +- c3

Then I would expect to see the following classpath being generated:
  myproject classes;a;b;c;a1;a2;a3;b1;b2;b3;c1;c2;c3

I attached the corresponding .classpath  for the little test I previously attached.


> Correct classpath ordering in .classpath
> ----------------------------------------
>                 Key: MECLIPSE-388
>                 URL:
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.4
>            Reporter: Siarhei Dudzin
>            Assignee: Barrie Treloar
>            Priority: Critical
>             Fix For: 2.9
>         Attachments: ideal.classpath, MECLIPSE-388-it-test.patch, MECLIPSE-388.patch,
> Currently plugin sorts artifacts on its own (alphabetic order???) because the order of
dependencies that comes from maven is not reliable (random?). This breaks tests that use JBoss
Embedded which works under maven surefire plugin because it still puts dependencies that came
first at the beginning of the classpath). Apparently not all classpath elements are put in
random order. At least I get the first ones listed in dependencies also first in the classpath
(can be seen as ${surefire.test.class.path} and in target/surefire-reports/TEST-TestSuite.xml).
> While there is not much we can do for maven eclipse plugin a solution is on the way:
MNG-1412. When maven 2.0.9 is released maven eclipse plugin can revert back to the default
classpath order.
> Can we somehow schedule this?
> Another question: is there anyway to put certain dependencies in the first place except
for renaming them so that alphabetic order does the job?

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message