当我使用快照版本(例如mvn clean deloy
)运行1.0.0-SNAPSHOT
以将项目部署到我们的企业关系时,我总是会遇到以下构建失败。当我使用发行版本运行相同的命令(例如1.0.0
)时,发布存储库的部署将顺利运行,文件将保存在nexus中:
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ META-POM ---
Downloading: http://urlofmynexus:port/nexus/content/repositories/nameofmygroup-snapshot/my/package/META-POM/1.0.0-SNAPSHOT/maven-metadata.xml
Uploading: http://urlofmynexus:port/nexus/content/repositories/nameofmygroup-snapshot/my/package/META-POM/1.0.0-SNAPSHOT/META-POM-1.0.0-20160602.102009-1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.640 s
[INFO] Finished at: 2016-06-02T12:20:09+02:00
[INFO] Final Memory: 12M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project META-POM: Failed to deploy artifacts: Could not find artifact my.package:META-POM:pom:1.0.0-20160602.102009-1 in nexus (http://urlofmynexus:port/nexus/content/repositories/nameofmygroup-snapshot) -> [Help 1]
这是完整的日志,我没有得到任何HTTP错误,因为如果我的凭据错误,我会得到。我检查了我的代理设置(如[Help 1]
中所述和一些SO问题)并从nexus(公共和私有存储库)获取工件或部署版本工作正常,只部署快照总是失败。
我现在的问题是:
<uniqueVersion>false</uniqueVersion>
后,时间戳会添加到快照版本的文件名中? (次级)我的settings.xml:
<servers>
<server>
<id>nexus</id>
<username>nexususer</username>
<password>nexuspw</password>
</server>
</servers>
<profiles>
<profile>
<id>nexus</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>nexus</id>
<url>http://urlofmynexus:port/nexus/content/groups/nameofmygroup-group</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
</profile>
</profiles>
project.pom中的distributionManagement
:
<distributionManagement>
<snapshotRepository>
<id>nexus</id>
<name>Snapshots</name>
<url>http://urlofmynexus:port/nexus/content/repositories/nameofmygroup-snapshot</url>
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
<repository>
<id>nexus</id>
<name>Releases</name>
<url>http://urlofmynexus:port/nexus/content/repositories/nameofmygroup-releases</url>
</repository>
</distributionManagement>
修改附加信息:
答案 0 :(得分:0)
每件事看起来都不错。但很久以前我也有同样的错误。我只是拼错了存储库名称。
所以再次检查网址
http://urlofmynexus:port/nexus/content/repositories/nameofmygroup-snapshot
或
http://urlofmynexus:port/nexus/content/repositories/nameofmygroup-snapshots
最后的(s)