Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven install file manually without version

Tags:

maven-2

jar

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
like image 731
coolguy Avatar asked Jun 14 '26 22:06

coolguy


2 Answers

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

You can't.

like image 180
Pascal Thivent Avatar answered Jun 17 '26 12:06

Pascal Thivent


This works for war packages. I haven't tried it for jars.

<build>
<!-- Ensures that the version number is not included in the packaged file name -->
<finalName>myrenamedpackage</finalName>
</build>
like image 23
user697547 Avatar answered Jun 17 '26 11:06

user697547



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!