You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by berc46 <ja...@gmail.com> on 2013/10/15 15:24:19 UTC

Multiple versions of same local jar

Hi,

I'm using Maven for a Web project within Eclipse.

The project uses some libraries from the Maven repository, and 3 of my
libraries, which I've added to my local repository with the mvn
deploy:deploy-file command.

Whenever I package my .war file in Eclipse, I end up with an archive that
contains multiple versions of 2 of my personal libraries, even though my
dependencies only mention the latest library for each one.

In other words, I have a .war with the following structure :

Project.war
  - ...
  - WEB-INF
    - lib
      - ...
      - PersonalLib1-1.0.jar
      - PersonalLib1-1.1.jar
      - PersonalLib1-1.2.jar
      - ...
      - PersonalLib2-1.0.jar
      - PersonalLib2-1.1.jar
      - PersonalLib2-1.2.jar
      - PersonalLib2-1.3.jar
      - PersonalLib2-1.4.jar
      - ...

Any ideas ?



--
View this message in context: http://maven.40175.n5.nabble.com/Multiple-versions-of-same-local-jar-tp5773089.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple versions of same local jar

Posted by Jörg Schaible <jo...@gmx.de>.
berc46 wrote:

> Hi,
> 
> I'm using Maven for a Web project within Eclipse.
> 
> The project uses some libraries from the Maven repository, and 3 of my
> libraries, which I've added to my local repository with the mvn
> deploy:deploy-file command.
> 
> Whenever I package my .war file in Eclipse, I end up with an archive that
> contains multiple versions of 2 of my personal libraries, even though my
> dependencies only mention the latest library for each one.
> 
> In other words, I have a .war with the following structure :
> 
> Project.war
>   - ...
>   - WEB-INF
>     - lib
>       - ...
>       - PersonalLib1-1.0.jar
>       - PersonalLib1-1.1.jar
>       - PersonalLib1-1.2.jar
>       - ...
>       - PersonalLib2-1.0.jar
>       - PersonalLib2-1.1.jar
>       - PersonalLib2-1.2.jar
>       - PersonalLib2-1.3.jar
>       - PersonalLib2-1.4.jar
>       - ...
> 
> Any ideas ?

You use overlays? Those content will simply be merged.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple versions of same local jar

Posted by Anders Hammar <an...@hammar.net>.
I view that as a patch solution of something else being wrong. You
shouldn't need to do that normally.

/Anders


On Wed, Oct 16, 2013 at 10:19 AM, Vincent Latombe <vincent.latombe@gmail.com
> wrote:

> Also, you can define a fileNameMapping to drop the version number
>
> http://maven.apache.org/plugins/maven-war-plugin/examples/file-name-mapping.html
> That way, new versions will erase old versions.
>
> Vincent
>
>
> 2013/10/16 berc46 <ja...@gmail.com>
>
> > Yup, Idea 1 is right, thx !
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://maven.40175.n5.nabble.com/Multiple-versions-of-same-local-jar-tp5773089p5773104.html
> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Multiple versions of same local jar

Posted by Vincent Latombe <vi...@gmail.com>.
Also, you can define a fileNameMapping to drop the version number
http://maven.apache.org/plugins/maven-war-plugin/examples/file-name-mapping.html
That way, new versions will erase old versions.

Vincent


2013/10/16 berc46 <ja...@gmail.com>

> Yup, Idea 1 is right, thx !
>
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Multiple-versions-of-same-local-jar-tp5773089p5773104.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Multiple versions of same local jar

Posted by berc46 <ja...@gmail.com>.
Yup, Idea 1 is right, thx !




--
View this message in context: http://maven.40175.n5.nabble.com/Multiple-versions-of-same-local-jar-tp5773089p5773104.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple versions of same local jar

Posted by Nick Stolwijk <ni...@gmail.com>.
Idea 1:
You started of with one version and build your war multiple times while
updating the version. Maven does not automatically clean the WEB-INF/lib
folder in your target folder. Try a "mvn clean install" instead of just a
"mvn install".

Idea 2:
You have multiple versions of your lib in your dependency tree, but with
different groupId's. Maven will think those are different jar files. Check
your dependency tree with "mvn dependency:tree" to see where those
dependencies come from.

Hth,

Nick Stolwijk

~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling that at any rate you
have not wasted your time but have done your best ~~~

Lord Baden-Powell


On Tue, Oct 15, 2013 at 3:24 PM, berc46 <ja...@gmail.com> wrote:

> Hi,
>
> I'm using Maven for a Web project within Eclipse.
>
> The project uses some libraries from the Maven repository, and 3 of my
> libraries, which I've added to my local repository with the mvn
> deploy:deploy-file command.
>
> Whenever I package my .war file in Eclipse, I end up with an archive that
> contains multiple versions of 2 of my personal libraries, even though my
> dependencies only mention the latest library for each one.
>
> In other words, I have a .war with the following structure :
>
> Project.war
>   - ...
>   - WEB-INF
>     - lib
>       - ...
>       - PersonalLib1-1.0.jar
>       - PersonalLib1-1.1.jar
>       - PersonalLib1-1.2.jar
>       - ...
>       - PersonalLib2-1.0.jar
>       - PersonalLib2-1.1.jar
>       - PersonalLib2-1.2.jar
>       - PersonalLib2-1.3.jar
>       - PersonalLib2-1.4.jar
>       - ...
>
> Any ideas ?
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Multiple-versions-of-same-local-jar-tp5773089.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>