Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven 3 install:install-file not working

Tags:

maven

I want to install a jar file to the 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

It reported successful.

But in my project, there's still an error with daozero dependency.

I checked the file location /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 anyone help me to understand what's going on? It worked before in maven 2.x.

like image 394
user1942964 Avatar asked Jan 02 '13 13:01

user1942964


3 Answers

I had a similar issue where the files were not being copied from a relative path.

Try using the fully qualified path of 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
like image 152
Atonewell Avatar answered Oct 18 '22 17:10

Atonewell


I know this is an old problem, just sharing my experience for other people,

I had the same issues, then I realized that I put a wrong name to the jar I am referring to.

Maven didn't complain and finished with success message, but didn't copy the jar :)

Regards Lyju

like image 36
Lyju I Edwinson Avatar answered Oct 18 '22 18:10

Lyju I Edwinson


Don't know if this is the issue, but you forgot a space between one of your commandline parameters:

./mvn install:install-file -Dfile=~/Downloads/daozero-0.5.jar -DgroupId=daozero -DartifactId=daozero -Dversion=0.5 -Dpackaging=jar
like image 40
asgoth Avatar answered Oct 18 '22 18:10

asgoth