-->

出版常春藤快照与Maven元(Publishing Ivy SNAPSHOTS with Maven

2019-08-19 02:57发布

I have an Ivy project that publishes its artifacts to a Nexus Maven repository. I then need other Maven projects to be able to use those jars as dependencies. I have been able to get Ivy to create and upload the pom.xml along with the jars, which is working fine. The problem is, when I use Ivy to publish a new SNAPSHOT version - none of the Maven projects will retrieve the new snapshot dependency, even if I do:

mvn clean install -U

I have noticed that Ivy does not publish a maven-metadata.xml file to the repos -- I assume that is the problem? If so, are there any ways to get Ivy to produce this?

Answer 1:

常春藤可以配置解析相关性(见的“m2compatible”属性时,读取该文件ibilio解析器),但发布任务不会创建或更新该文件.....

表面上看,这是客户的工作,以创建和更新“的maven-metadata.xml中”文件....这是Maven仓库的无证功能。 (如果在那里的描述有人能找到,也许是一个错误常春藤可以固定)。

标准的解决办法是定期安排的Nexus任务来重新生成元数据文件。 看到:

  • http://www.sonatype.com/people/2009/09/nexus-scheduled-tasks/

一个更极端的解决办法是使用Maven的ANT任务来执行发布一步....

评上的快照修订

最近一个时期,我来到该快照版本是不值得的结论。 连续交付促进了每个版本是潜在的释放和常春藤有一个漂亮的概念buildnumber确保每个版本是唯一的任务。 我发现我的构建过程比较简单,当只有一种身材。

快照是使用Maven等项目共享发展构建工件时,只需要一个特征。 恕我直言,常春藤的动态修正功能更强大,因为他们解决在构建时“最新”版本。 请参阅如何交付任务与联合makepom在下面的示例任务:

  • 转换的ivy.xml到的pom.xml
  • 使用ant脚本自动为我所有的项目常春藤修订增加


Answer 2:

我有一个类似的问题,发现下面的网站有帮助的解决它: http://ssinghvi.wordpress.com/2012/01/26/unable-to-retrieve-latest-artifact-from-sonatype-nexus-using-apache -常春藤/

基本上用<ibiblio name="Maven Central" m2compatible="true" useMavenMetadata="false" root="http://…" />



文章来源: Publishing Ivy SNAPSHOTS with Maven metadata