Kadinski
Kadinski

Reputation: 161

Deploy 3rd party JAR to local repository

I have a jar that I would like to deploy using deploy:deploy-file to a local directory. What should I use for the required -DrepositoryId and -Durl options?

my current attempt:

egeller$ mvn deploy:deploy-file -DgroupId=net.sample \
-DartifactId=sample-artifact -Dversion=4.5.1  -Dpackaging=jar \
-Dfile=sample-sdk.jar -DrepositoryId=local \
-Durl=file://Users/egeller/agent/deploy-agent/

results in the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: 
Failed to deploy artifacts: Could not transfer artifact net.sample:sample-artifact:jar:4.5.1 from/to local (file://Users/egeller/agent/deploy-agent/): 
Repository path /egeller/agent/deploy-agent/ does not exist, and cannot be created.

thanks!

Upvotes: 2

Views: 1824

Answers (2)

Kadinski
Kadinski

Reputation: 161

The issue was that I should have set -Durl to a directory relative to the current working directory, rather than an absolute path. -DrepositoryId can be left blank in this case.

Working version:

egeller$ mvn deploy:deploy-file -DgroupId=net.sample \
-DartifactId=sample-artifact -Dversion=4.5.1  -Dpackaging=jar \
-Dfile=sample-sdk.jar \
-Durl=file://repo-name

Upvotes: 1

Jigar Joshi
Jigar Joshi

Reputation: 240860

Repository path /egeller/agent/deploy-agent/ does not exist, and cannot be created.

means you provided incorrect path as per the comment discussion

Upvotes: 1

Related Questions