How do I find the latest version of an artifact from a maven repository

前端 未结 2 1652
孤城傲影
孤城傲影 2021-01-30 09:08

As part of an automated deployment I need a script to download the latest version of an artifact from our internal repository.

Ideally this script will be with ant or a

2条回答
  •  日久生厌
    2021-01-30 09:33

    You can parse the maven-metadata.xml to see what versions are available, and which version is the "release" version. See this answer about plugin versions for more details.

    If you are using Nexus, you can use the REST API to query the repository. You can also use the REST client API to simplify your processing.

    To update the release version, activate the release-profile in the Maven super POM when you do mvn deploy. You can do this by adding -Prelease-profile or -DperformRelease=true to the command line.

    The profile is activate by default in the maven-release-plugin's perform goal. It is controlled by the useReleaseProfile property. See the release-perform goal's documentation for more details.

提交回复
热议问题