Maven 3 install: install-file does not work

I want to install the jar file in a local repository using maven 3.0.4 .

I used:

./mvn install:install-file -Dfile=~/Downloads/daozero-0.5.jar -DgroupId=daozero-DartifactId=daozero -Dversion=0.5 -Dpackaging=jar 

Successful completion reported.

But in my project, there is still a bug with the daozero dependency.

I checked the location of the file /Users/someuser/.m2/repository/daozero/daozero/0.5/ and found that there was no file: daozero-0.5.jar

 <dependency> <groupId>daozero</groupId> <artifactId>daozero</artifactId> <version>0.5</version> <scope>compile</scope> </dependency> 

Can someone help me understand what is happening? It worked before in maven 2.x.

+7
source share
4 answers

I had a similar problem when the files were not copied from the relative path.

Try using the full path to the jar file instead of ~.

eg:

 ./mvn install:install-file -Dfile=/home/user1942964/Downloads/daozero-0.5.jar -DgroupId=daozero -DartifactId=daozero -Dversion=0.5 -Dpackaging=jar 
+11
source

I know this is an old problem, just share my experience with other people,

I had the same problems and realized that I entered the wrong name in the jar I'm talking about.

Maven did not complain and finished a successful message, but did not copy the jar :)

Relations Lyju

+3
source

I don’t know if this is a problem, but you forgot the space between one of the parameters of your command line:

 ./mvn install:install-file -Dfile=~/Downloads/daozero-0.5.jar -DgroupId=daozero -DartifactId=daozero -Dversion=0.5 -Dpackaging=jar 
+1
source

I installed the jar locally using mvn install: install-file, but Netbeans did not let me add the jar as a dependency. Turns out the problem was with Netbeans.

I went to Services -> Maven Repositories -> local (right click), then did "Update Index". Then I went back to my project -> added dependency and was able to see it.

After executing the "update index" do not look at the tree, the new bank may not appear in the "Services". Just go back to the project and try to add it. Good luck

0
source

All Articles