Maven War Plugin picking multiple version of the same SNAPSHOT jars

some of my web project's dependencies are other modules from the same app, that are not a part of the build, yet (legacy, haven't had time to mavenize them yet). So we use our Nexus installation and deploy these dependencies to it. Everything seems to work fine, but when creating the WAR, duplicate versions of these jars are included in the WAR, with different names, for example:

 

586179 Thu Jun 03 10:40:34 IDT 2010 WEB-INF/lib/semantic-server-3.01-20100601.112610-1.jar
586179 Thu Jun 03 12:13:56 IDT 2010 WEB-INF/lib/semantic-server-3.01-SNAPSHOT.jar

 

obviously, this has something to do with the snapshot mechanism...

has anyone seen this behavior? how can I make sure only one jar is taken?

 

thanks!

 

attachments:

1. project pom (pom.xml)

2. parent pom (pom_0.xml)

AttachmentSize
pom.xml9.11 KB
pom.xml9.07 KB

Comments

Why (HOW) did you deploy semantic artifact as SNAPSHOT. 

As I know nexus doesn't allow to deploy SNAPSHOTs using web UI to snapshot repositories.

Usually 3rdparty  artifacts we deploy to the hosted 3rdparty repository as releases

thanks,

I used deploy:deploy-file

btw,

these are not 3rd party dependencies,

just other modules in the same application that keep changing (bugfixes) without the version changed...

 

 try to re- deploy:deploy-file with uniqueVersion=false

default is true and it creates artifacts with timestamp in case of snapshots

thanks! that solved the filename issue :)

Maybe some transitive dependency got in your way, did you try to see where it came from?

 

mvn dependency:tree -Dverbose -Dincludes=com.mindcite.citer:semantic-server

thanks,

 

I found out where the duplicates came from... I used a pom sample for a GWT project, which utilized the dependency plugin for copying all dependencies to war/WEB-INF/lib directory, and these jars were then copied copied into the WAR file together with the rest of the war directory (which was defined as the <warSourceDirectory> in maven-war-plugin definition)

 

After I removed the dependency plugin (which was not needed at all), I got rid of the duplicates. Now the only problem I have is that the filename is dirty, i.e. contains serial number. I'll try Mark and Itai's suggestions for fixing that

 

thanks!

Do you deploy it to snapshot repository ?

Dose the repository definition include snapshot support in your pom ?

 <snapshots>
        <enabled>true</enabled>
 </snapshots>

 

thanks,

adding the definition above did not change the jar filename that was packed in the war. but I got rid of the duplicate jars (dependency-plugin definitions that were not needed, just wrote Shalom about it).

Since this is a question of pretty filenames, I guess I could leave it... or try Mark's advice.

 

thanks!

 

 jar names may be changed by property outputFilaNameMapping of WAR pluign

setting ${artifact.artifactId}.${artifact.extension} will change file name to semantic-server.jar

even better! thanks :))