英文:
Could not find artifact when deploying artifact to Nexus
问题
我正在将一个允许重新部署的构件部署到Nexus快照存储库,使用以下Maven命令:
mvn deploy:deploy-file -Durl=https://t-nexus.perque.com/service/repository/t-PASTIS -DrepositoryId=t-nexus.perque-snapshots -DgroupId=com.perque -DartifactId=pastis -Dversion=0.0.1-SNAPSHOT -Dpackaging=war -Dfile=pastis.war -DgeneratePom=true -e -X
但是我遇到了这个错误:
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not find artifact com.perque:pastis:war:0.0.1-20200817.082538-1 in t-nexus.perque-snapshots (https://t-nexus.perque.com/service/repo/t-PASTIS)
使用Nexus存储库页面上的上传按钮一切正常进行。
英文:
I am deploying an artifact to a Nexus snapshot repository that allows redeployment, using the maven command:
mvn deploy:deploy-file -Durl=https://t-nexus.perque.com/service/repository/t-PASTIS -DrepositoryId=t-nexus.perque-snapshots -DgroupId=com.perque -DartifactId=pastis -Dversion=0.0.1-SNAPSHOT -Dpackaging=war -Dfile=pastis.war -DgeneratePom=true -e -X
but I have this error:
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not find artifact com.perque:pastis:war:0.0.1-20200817.082538-1 in t-nexus.perque-snapshots (https://t-nexus.perque.com/service/repo/t-PASTIS)
usin the upload button of the Nexus repo page everything is going well
答案1
得分: 1
希望您的主机名和路径是正确的。如果是这样,请尝试以下步骤-
如果您在代理后面,请在 settings.xml(~/.m2/ 目录)中尝试添加以下内容
<proxies>
<proxy>
...
<nonProxyHosts>yourserver</nonProxyHosts>
</proxy>
</proxies>
像下面这样添加服务器详细信息。
<server> <id>xx</id><username>serverUser</username><password>password</password> </server>
我之前在第三方 jar 中遇到类似的错误... 我将配置设置为发布版本,而不是快照版本,针对第三方 repo。您也可以尝试这样做。
英文:
Hope your hostname & path is correct . if so try below things-
you should try adding below if behind proxy in settings.xml ( ~/.m2/ directory)
<proxies>
<proxy>
...
<nonProxyHosts>yourserver</nonProxyHosts>
</proxy>
</proxies>
Add server details like below.
<server> <id>xx</id><username>serverUser</username><password>password</password> </server>
also i had similar error for third party jar .. i did set configuration to release instead of snapshot for 3rd party repo. so try that as well
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论