Nexus 3 : how to get latest snapshot?

前端 未结 5 1608
日久生厌
日久生厌 2021-02-10 05:20

As we all know Nexus 3 does not have REST API yet, which is very weird for me. I can only download artifacts manually using wget or curl. But as I\'m using Maven 3, all the snap

5条回答
  •  有刺的猬
    2021-02-10 06:02

    If keeping only one SNAPSHOT in the repository is a valid option

    This API call will work: ${nexusUrl}/service/rest/beta/search/assets/download?maven.groupId=${groupId}&maven.artifactId=${artifactId}&maven.baseVersion=${version}

    Though there is finally a Nexus3 API (see more on this in Sonatype's blog), the API does not yet provide the means to get the last SNAPSHOT version. This situation will hopefully be improved in the future: NEXUS-14407 is tracking this feature request.

    But until then I'm workarounding the problem by defining a Maven - Delete SNAPSHOT Task:

    and configuring it to run every minute deleting all but 1 snapshot versions older than 0 days:

提交回复
热议问题