无法在将构件部署到Nexus时找到构件。

huangapple go评论70阅读模式
英文:

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)

&lt;proxies&gt;
  &lt;proxy&gt;
    ...
    &lt;nonProxyHosts&gt;yourserver&lt;/nonProxyHosts&gt;
  &lt;/proxy&gt;
&lt;/proxies&gt;

Add server details like below.

&lt;server&gt; &lt;id&gt;xx&lt;/id&gt;&lt;username&gt;serverUser&lt;/username&gt;&lt;password&gt;password&lt;/password&gt; &lt;/server&gt;

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

huangapple
  • 本文由 发表于 2020年8月17日 16:33:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/63447312.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定