User Tools

Site Tools


java:nexus3:latestbyrest

<Code:bash> curl –user user:password -sSL -X GET -G “https://nexus.url/service/rest/v1/search/assets” \

  1. d repository=maven-snapshots \
  2. d maven.groupId=info.elsener \
  3. d maven.artifactId=artifact \
  4. d maven.baseVersion=1.0.0-SNAPSHOT \
  5. d maven.extension=zip \
  6. d maven.classifier=bin \

| grep -Po '“downloadUrl” : “\K.+(?=”,)' \

| sort \
| tail -1 \
| xargs curl --user user:password -fsSL -o /tmp/artifact-bin.zip

</Code>

  1. Get all artifact information for base version
  2. extract download urls
  3. sort urls (there is a timestamp in)
  4. get last entry
  5. download artifact
java/nexus3/latestbyrest.txt · Last modified: 2020/06/27 18:58 by els