Resolution

How to find the latest artifact version based on layout?

AuthorFullName__c
Maayan Amrani
articleNumber
000004219
ft:sourceType
Salesforce
FirstPublishedDate
2018-07-25T14:27:16Z
lastModifiedDate
2024-03-10T07:47:19Z
VersionNumber
7

We have created an example of a new layout, according to an RPM package, and changed the layout of the repository to the new one:

[orgPath]/[module]-[baseRev](-[fileItegRev])-[classifier].[ext]

Then, we deployed an RPM package to Artifactory (to the repository ‘rpm-local’) with the following path:

rpm-local/centos/7/x86_64/cloudmunch-def-plugin-87-1.x86_64.rpm

As can be seen below, Artifactory identifies the version of the package according to the BaseRev we deployed:

User-added image

Once the layout matches, you should be able to use the mentioned API to find the latest version. For example:

$ curl ARTIFACTORY_URL/api/search/latestVersion?g=centos.7&a=x86_64&repos=rpm-local

99

The latest artifact version based on layout in repository ‘rpm-local’, is 99 (as can be seen in the screenshot below).

User-added image

In addition, you may also use AQL to query Artifactory for almost anything you want.

AQL is a dedicated query language which can be used to retrieve essential outputs according to your requirements.