You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Simon Kepp Nielsen <si...@pfa.dk> on 2006/04/20 21:47:56 UTC
[m2] Controlling the order of dependencies in the classpath
Hi all,
I am currently migrating a large project from Maven 1 to Maven 2, but have run in to a bit of a problem: One of the sub-projects fails to compile under Maven 2, although it works fine under Maven 1 and they have exactly the same dependencies.
Aparently, the problem is in the order of the dependencies. Two of the jar files the project depends on contain different definitions of the same class. In Maven 1, the jars appear in the compiler classpath in the order they are declared in the POM, so here it works fine, but in Maven 2, the jars are in the wrong order no matter what order they are listed in the POM.
Is there any other way to force the order the dependencies appear in the classpath?
Best regards,
Simon Kepp Nielsen, Configurations Manager
PFA Pension, Teknisk Arkitektur
- Mobil: 30 52 77 07
E-mail: sin@pfa.dk
PFA Pension
Sundkrogsgade 4
2100 København Ø
Forbehold
Denne e-mail kan indeholde personlige og fortrolige oplysninger. Modtager du e-mailen ved en fejl, bedes du returnere den til afsender hurtigst muligt uden at distribuere, kopiere, eller arkivere e-mailen.
Disclaimer
This message is for the designated recipient only and may contain confidential or privileged information. If you have received the message in error, please notify the sender by replying the e-mail and delete the message without copying or disclosing.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Controlling the order of dependencies in the classpath
Posted by Wayne Fay <wa...@gmail.com>.
This has been discussed very recently (in the past couple of days) so
be sure to check the User list archives for more info.
In short, no, there is no way to order the jars in M2. Instead, you
should use exclusions to eliminate the "bad" jar/dependency.
Wayne
On 4/20/06, Simon Kepp Nielsen <si...@pfa.dk> wrote:
> Hi all,
>
> I am currently migrating a large project from Maven 1 to Maven 2, but have run in to a bit of a problem: One of the sub-projects fails to compile under Maven 2, although it works fine under Maven 1 and they have exactly the same dependencies.
>
> Aparently, the problem is in the order of the dependencies. Two of the jar files the project depends on contain different definitions of the same class. In Maven 1, the jars appear in the compiler classpath in the order they are declared in the POM, so here it works fine, but in Maven 2, the jars are in the wrong order no matter what order they are listed in the POM.
>
> Is there any other way to force the order the dependencies appear in the classpath?
>
>
> Best regards,
>
> Simon Kepp Nielsen, Configurations Manager
> PFA Pension, Teknisk Arkitektur
> - Mobil: 30 52 77 07
> E-mail: sin@pfa.dk
>
>
> PFA Pension
> Sundkrogsgade 4
> 2100 København Ø
>
> Forbehold
> Denne e-mail kan indeholde personlige og fortrolige oplysninger. Modtager du e-mailen ved en fejl, bedes du returnere den til afsender hurtigst muligt uden at distribuere, kopiere, eller arkivere e-mailen.
>
> Disclaimer
> This message is for the designated recipient only and may contain confidential or privileged information. If you have received the message in error, please notify the sender by replying the e-mail and delete the message without copying or disclosing.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>