Multiple versions of the same dependency in Maven

Is it possible to declare multiple versions of the same dependency in a Maven repo?
I need these dependencies all at once:


    <dependency>
        <groupId>org.bukkit</groupId>
        <artifactId>craftbukkit</artifactId>
        <version>1.7.9-R0.2</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.bukkit</groupId>
        <artifactId>craftbukkit</artifactId>
        <version>1.7.2-R0.3</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.bukkit</groupId>
        <artifactId>craftbukkit</artifactId>
        <version>1.6.4-R2.0</version>
        <scope>compile</scope>
    </dependency>



Because each of them contains a different package I care about:

    org.bukkit.craftbukkit.v1_6_R3

    org.bukkit.craftbukkit.v1_7_R1

    org.bukkit.craftbukkit.v1_7_R3



If I declare dependencies as shown in the first snippet, only the last one will take effect. Is there any way to achieve this in Maven?
.




 

Inshtigs like this liven things up around here.

 

Not last one, will be pickup by Maven is latest one. This is very rare scenario which I am looking at first time.

As a developer any new version comes our code should be migrated as per latest, not the case where you can use the code from old version and new version..

Only you can do is try to change the artifact Id for old version.. This may help you.. This is also will not a perfect solution you may conflicts with deployment. but try once

 
Post a Reply
Captcha Image