You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Troy Bull <tr...@gmail.com> on 2008/11/12 15:52:30 UTC

Maven includes old jar versions

Greetings

I am brand new to maven and I have just noticed an issue.

I have a jar file that I maintain in my local maven repository (on my
workstation).  It has had several versions, 2.0.2, 2.0.3 2.0.5 etc.

I have a different project that is built with maven that uses this jar
file.  If I change the jar file I update the version of the jar file.

I then update my pom.xml file to fetch the new version of the jar.  I
opened up my war file and noticed quite by accident that mvn is
including all the versions of the jar file in the WEB-INF/lib
directory.  Is there something I need to do special to tell mvn to
only include the most recent version of the jar file?

Here is the section of the pom.xml that includes the jar file in question:


		<dependency>
			<groupId>org.ifmc</groupId>
			<artifactId>ifmccommon</artifactId>
			<version>2.0.5.r5943</version>
			<scope>compile</scope>
		</dependency>



Thanks in advance

Troy


-- 
A computer without a Microsoft operating system is like a dog without
bricks tied to its head.

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


Re: Maven includes old jar versions

Posted by Martin Höller <ma...@xss.co.at>.
On Wednesday 12 November 2008 Troy Bull wrote:
> I have a jar file that I maintain in my local maven repository (on my
> workstation).  It has had several versions, 2.0.2, 2.0.3 2.0.5 etc.
>
> I have a different project that is built with maven that uses this jar
> file.  If I change the jar file I update the version of the jar file.
>
> I then update my pom.xml file to fetch the new version of the jar.  I
> opened up my war file and noticed quite by accident that mvn is
> including all the versions of the jar file in the WEB-INF/lib
> directory.  Is there something I need to do special to tell mvn to
> only include the most recent version of the jar file?

Try a "mvn clean". This will solve your issue.

The reason is, that the old JARs from previous builds remain in your 
target/<projectId>/ directory which is the directory that will be zipped to 
your final war file.

hth,
- martin

Re: Maven includes old jar versions

Posted by Brian Fox <br...@reply.infinity.nu>.
Do a clean install after changing the pom since the target folder  
would already have a copy of the previous version.

--Brian (mobile)


On Nov 12, 2008, at 9:52 AM, "Troy Bull" <tr...@gmail.com> wrote:

> Greetings
>
> I am brand new to maven and I have just noticed an issue.
>
> I have a jar file that I maintain in my local maven repository (on my
> workstation).  It has had several versions, 2.0.2, 2.0.3 2.0.5 etc.
>
> I have a different project that is built with maven that uses this jar
> file.  If I change the jar file I update the version of the jar file.
>
> I then update my pom.xml file to fetch the new version of the jar.  I
> opened up my war file and noticed quite by accident that mvn is
> including all the versions of the jar file in the WEB-INF/lib
> directory.  Is there something I need to do special to tell mvn to
> only include the most recent version of the jar file?
>
> Here is the section of the pom.xml that includes the jar file in  
> question:
>
>
>                 <dependency>
>                         <groupId>org.ifmc</groupId>
>                         <artifactId>ifmccommon</artifactId>
>                         <version>2.0.5.r5943</version>
>                         <scope>compile</scope>
>                 </dependency>
>
>
>
> Thanks in advance
>
> Troy
>
>
> --
> A computer without a Microsoft operating system is like a dog without
> bricks tied to its head.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>