Publishing Ivy SNAPSHOTS with Maven metadata

孤街浪徒 提交于 2019-11-29 05:16:28
Mark O'Connor

Ivy can be configured to read this file when resolving dependencies (see the "m2compatible" attribute of the ibilio resolver), but the publish task does not create or update this file.....

Seemingly it's the client's job to create and update the "maven-metadata.xml" file.... This is an undocumented feature of Maven repositories. (If someone could find where it's described, perhaps an ivy bug could be fixed).

The standard work-around is to periodically schedule a Nexus task to regenerate the metadata files. See:

A more extreme solution is to use the Maven ANT task to perform the publish step....

Commentary on snapshot revisions

In recent times I've come to the conclusion that snapshot releases are not worth the effort. Continuous delivery promotes the concept that each build is potentially releasable and ivy has a nifty buildnumber task which ensures each build is unique. I find my build process is simpler when there is only one kind of build.

Snapshots is a feature only required when sharing development build artifacts with other projects using Maven. IMHO ivy's dynamic revision features are more powerful because they resolve the "latest" revision at build time. See how the deliver task is combined with the makepom task in the following examples:

I had a similar problem and found the following website helpful in solving it: http://ssinghvi.wordpress.com/2012/01/26/unable-to-retrieve-latest-artifact-from-sonatype-nexus-using-apache-ivy/

Basically use <ibiblio name="Maven Central" m2compatible="true" useMavenMetadata="false" root="http://…" />

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!