maven - mvn deploy:deploy-file -- Failed to deploy artifacts: Could not find artifact -
i trying add 3rd party vendor's jar our internal nexus repository.
i have tried using command:
mvn deploy:deploy-file -dgroupid=acme -dartifactid=acme -dversion=1.0 -dpackaging=jar -dfile=c:\tmp\acme-1.0.jar -drepositoryid=nexus -durl=http://myserver:8888/nexus/content/repositories/thirdparty/
with following entry in settings.xml:
<servers> <server> <id>nexus</id> <username>myusername</username> <password>mypassword</password> </server> </servers>
but error:
[error] failed execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7: deploy-file (default-cli) on project standalone-pom: failed deploy artifacts: not find artifact acme:acme:jar:1.0 in nexus (http://myserver:8888/nexus/c ontent/repositories/thirdparty) -> [help 1]
any suggestions?
some related info... can install local repository fine, using command:
mvn install:install-file -dgroupid=acme -dartifactid=acme -dversion=1.0 -dpackaging=jar -dfile=c:\tmp\acme-1.0.jar
i have tried 'artifact upload' via nexus web interface, using gav parameters:
group: acme artifact: acme version: 1.0 packaging: jar
and selecting & adding acme-1.0.jar. completes fine, "mvn install" on project depending on jar results in:
could not find artifact acme:acme:jar:1.0 in nexus (http://myserver:8888/nexus/content/groups/public)
my pom contains:
<repositories> <repository> <id>nexus</id> <url>http://myserver:8888/nexus/content/groups/public</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories>
any appreciated...
ps know question similar this one, issue there seemed use of jenkins url, instead of nexus url.
answering own question. resolved follows:
1) if behind proxy server (i.e. have proxy server setup in maven settings.xml) nexus server internal, may need add nexus server nonproxyhost in settings.xml e.g.
<proxies> <proxy> ... <nonproxyhosts>myserver</nonproxyhosts> </proxy> </proxies>
i realized needed because "mvn deploy:deploy-file"
command running did not seem reaching nexus repo @ all. example, change repo id, username or password in server section of settings.xml, , still same error. change url in deploy command gibberish (for example -durl=notexist
), or shutdown nexus repo, , still same error.
2) make sure 3rd party repository set release, rather snapshot. this, go web gui, select configuration tab of 3rd party repository, , make sure repository policy set to release.
i found out looking @ catalina.out log (i run nexus war in tomcat) , seeing following:
error org.sonatype.nexus.rest.contentplexusresource - got exception during processing request "put http://myserver:888/nexus/content/repositories/thirdparty/acme/acme/1.0/acme-1.0.pom": storing of item thirdparty:/acme/acme/1.0/acme-1.0.pom forbidden maven repository policy. because thirdparty snapshot repository
with 2 fixes in place, both "mvn deploy:deploy-file" command, , uploading via 'upload artifacts' option in web gui work.