Sergii Zhuravskyi
Sergii Zhuravskyi

Reputation: 4348

Jfrog Artifactory REST API Search for a latest version of an artifact

I am trying to retrieve the latest version of an artifact with the following query

http://artifactory_domain/artifactory/api/search/latestVersion?g=groupId&a=artifactId&v=0.101.1&repos=repository_on_artifactory

Where :

  1. artifactory_domain - domain name of your artifactory.
  2. groupId - you can find it Artifact Repository Browser, please, look into a screen shot.
  3. artifactId -you can find it Artifact Repository Browser, please, look into a screenshot.
  4. Repo name where artifact persists.

enter image description here

which is assembled in accordance with the following documentation https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-ArtifactLatestVersionSearchBasedonLayout

However, it returns lastest in accordance with the alphabetical order. For example:

The query returns 0.101.2 despite the fact that there is version 0.101.11 already.

Is there any flag/option to retrieve the latest version based on the created date?

Upvotes: 3

Views: 4918

Answers (1)

Sergii Zhuravskyi
Sergii Zhuravskyi

Reputation: 4348

I found answer by myself in documentation:

To change the retrieve latest behavior to retrieve the latest version based on the created date you can add the following flag to

  • $ARTIFACTORY_HOME/etc/artifactory.system.properties

and add the following flag

  • artifactory.request.searchLatestReleaseByDateCreated=true

and restart Artifactory service

Upvotes: 2

Related Questions