将工件部署到 Nexus 时找不到工件

Could not find artifact when deploying artifact to Nexus

我正在使用 maven 命令将工件部署到允许重新部署的 Nexus 快照存储库:

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 回购页面的上传按钮一切顺利

希望您的主机名和路径是正确的。如果是这样,请尝试以下操作-

如果在 settings.xml(~/.m2/ 目录)

中的代理后面,你应该尝试在下面添加
<proxies>
  <proxy>
    ...
    <nonProxyHosts>yourserver</nonProxyHosts>
  </proxy>
</proxies>

添加如下服务器详细信息。

<server> <id>xx</id><username>serverUser</username><password>password</password> </server>

我对第三方 jar 也有类似的错误。我确实将配置设置为发布而不是第 3 方回购的快照。所以也试试