The only maven version that guarantees deterministic order across jdk
and platforms is 2.0.9. Before that it was subject to the native set
ordering, but after we use linked sets.

The ordering in 2.0.9 is as the ordering in the pom + the parent poms +
grandparent etc. So the local pom takes precedence.

-----Original Message-----
From: Nick Pellow [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 22, 2008 10:38 PM
To: [email protected]
Subject: preserving order of dependencies

Hi,

I am developing a maven plugin which needs to add a dependency to the  
javac and surefire classpaths.

Using:

final Set set = getProject().getDependencyArtifacts();
set.add( myArtifact );
getProject().setDependencyArtifacts( set );

seems to work most of the time.
In certain situations however, depending on what dependencies are  
defined for the project, this seems to cause different versions of  
transitive dependencies to be resolved than when my plugin is not  
invoked. I notice that getProject().getDependencyArtifacts() is a  
java.util.HashSet.

I have tested this with both maven 2.0.8 and 2.0.9. The behavior is  
the same.

What is the safest way to add a dependency to the classpaths and  
preserve the order of those dependencies?

Any help is greatly appreciated.
Cheers,
Nick 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to