Search code examples
artifactory

How to get the latest artifact from artifactory with no properties


I was using "build": "Build/LATEST" to get the latest artifact but one of the artifact I want to download does not have properties to get the build name. Is there a way to get the latest artifact by layout of the repo? I was trying to use this

 GET http://localhost:8081/artifactory/api/search/latestVersion?g=mygroup&a=myartifactid&v=3.0.0-SNAPSHOT&repos=myrepo

but I don't know how to get the group id/artifact id or version.

thank you!


Solution

  • If I understand correctly you have different versions of an artifact in a layout.

    If so, you can use Retrieve Latest Artifact which will retrieve the latest artifact version by layout (you can also change the configuration to return the last created by date).

    Otherwise, you can use Item Last Modified to retrieve the item last modified at a path.

    Note that you tried using Artifact Latest Version Search Based on Layout which will only get you the version of the latest artifact, but not the artifact itself.