Search code examples
mavenartifactorymaven-metadata

How to rebuild maven-metadata.xml in Artifactory?


We're using Artifactory 3.9.2 and had to merge parts of two repositories (by copying over the artifacts) which had the same (SNAPSHOT-versioned) artifact. This screwed up the maven-metadata.xml. In Nexus its possible to simply rebuild the metadata for this artifact and let the repository manager sort out things for you. I can't seem to find any links/explanations on how to do this with Artifactory. Could somebody please tell me how I can do this?


Solution

  • I'm not sure if this is possible in the UI, but you can do it using the REST API. Try posting a request using curl:

    curl -v -X POST http://www.myartifactory.com/artifactory/api/maven/calculateMetadata/my-repository/com/foo/bar
    

    They decided to call it "calculate metadata" instead of "rebuild metadata" which is not very suitable IMHO.