tags:

views:

15

answers:

2

How do I add a jar file to my local repository without appending the version number to the jar file?

Lets say I have a jar file named abc.jar and run the following command, it will create abc-1.0.jar and if I bundle this artifact in a war file, the resulting file name will be abc-1.0.jar. If I remove the -Dversion, the command fails. If I mention blank value -Dversion="", then abc-.jar is created. How do I keep the original jar's filename(abc.jar)?

mvn install:install-file -Dfile="d:\abc.jar" -DgroupId=grp1 -DartifactId=art1 -Dversion=1.0 -Dpackaging=jar
+1  A: 

How do I add a jar file to my local repository without appending the version number to the jar file?

You can't.

Pascal Thivent
A: 

You can not change the name of the arifact in your maven repository, but you can configure the war plugin to use a specific nming scheme for the libs it bundles in WEB-INF/lib using the outputFileNameMapping option. To remove version information and classifiers the mapping pattern would be @{artifactId}@.@{extension}@. If the artifact id matches the original filename this should give the wanted result.

Jörn Horstmann