Artifact Latest Version Search Based on Layout



Description: Search for the latest artifact version by groupId and artifactId, based on the layout defined in the repository

Search can be limited to specific repositories (local, remote-cache, or virtual) by settings the repos parameter. When searching in a virtual repository, each child-repository layout will be consulted accordingly.

Latest release vs. latest integration: Unless the version parameter is specified, the search returns the latest artifact release version. When version is specified, e.g. 1.0-SNAPSHOT, the result is the latest integration version. Integration versions are determined by the Repository Layouts of the repositories searched. For integration search to work the repository layout requires an "Artifact Path Pattern" that contains the baseRev token and then the fileItegRev token with only literals between them.Repository Layouts

Remote searches: By default only local and cache repositories will be used. When specifying remote=1, Artifactory searches for versions on remote repositories. NOTE! that this can dramatically slow down the search.

For Maven repositories the remote maven-metadata.xml will be consulted. For non-Maven layouts, remote file listing runs for all remote repositories that have the 'List Remote Folder Items' checkbox enabled.

Filtering results (Artifactory 3.0.2+): The version parameter can accept the * and/or ? wildcards which will then filter the final result to match only those who match the given version pattern.

Artifact path pattern: The [org] and [module] fields must be specified in the artifact path pattern of the repository layout for this call to work.

Since: 2.6.0

Notes: Requires Artifactory Pro

Security: Requires a privileged user (can be anonymous)

Usage: GET /api/search/latestVersion?[g=groupId][&a=artifactId][&v=version][&remote=1][&repos=x[,y]]

Produces: text/plain

Sample Output:

GET /api/search/latestVersion?g=org.acme&a=artifact&v=1.0-SNAPSHOT&repos=libs-snapshot-local