Am 17.02.2012 04:51 schrieb "Nalini" <nalini...@huawei.com>:
>
> <dependencies>
>        <dependency>
>            <groupId>test</groupId>
>            <artifactId>castor</artifactId>
>            <version>0.9.5</version>
>        </dependency>
>        <dependency>
>            <groupId>test</groupId>
>            <artifactId>castor</artifactId>
>            <version>1.0.4</version>
>        </dependency>
> </dependencies>

Maven performs *conflict resolution* here. That means: if your dependencies
only differ by the version number, maven will pick *one* as dependency and
drop all other versions of the same groupId/artifactId.

>
> This is how my dependencies are declared. To use copy-dependencies
plug-in,

I guess you use the *goal* copy-dependencies of the
maven-dependency-plugin. Is this correct?

> I did something like
>  <execution>
>            <id>copy-to-lib</id>
>            <phase>validate</phase>
>            <goals>
>              <goal>copy-dependencies</goal>
>            </goals>
>            <configuration>
>                   <includeArtifactIds>caster</ includeArtifactIds>
>              <outputDirectory>${lib-location}</outputDirectory>
>              <overWriteReleases>false</overWriteReleases>
>              <overWriteSnapshots>false</overWriteSnapshots>
>              <stripVersion>false</stripVersion>
>              <excludeTransitive>true</excludeTransitive>
>            </configuration>
>  </execution>
>
> But this copies only one version and it ignores the other one.. Please
provide a solution for copying both the versions.

Have a look at the documentation of maven-dependency-plugin: under *Goals*,
read the section about goal *copy*. Learn how to specify the artifacts you
want to copy using <artifactItems>. There is no conflict resolution applied
to these items, only to maven dependencies.

Hope this helps

Ansgar

>
> Thanks and Regards,
> Nalini P G
>
> -----Original Message-----
> From: Wayne Fay [mailto:wayne...@gmail.com]
> Sent: Thursday, February 16, 2012 9:18 PM
> To: Maven Users List
> Subject: Re: Copy two versions of same jar
>
> > Can I copy two different versions of same jar using Maven?
> >
> > PS: These two jars have the same groupid and artifact id..
>
> Yes, you can since the V part of GAV is different.
>
> If you want a more detailed answer, please provide a more detailed
question.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>

Reply via email to