Artifactory Query Language

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

Artifactory Query Language (AQL) is specially designed to let you uncover any data related to the artifacts and builds stored within Artifactory. Its syntax offers a simple way to formulate complex queries that specify any number of search criteria, filters, sorting options, and output parameters. AQL is exposed as a RESTful API which uses data streaming to provide output data resulting in extremely fast response times and low memory consumption. AQL can only extract data that resides in your instance of Artifactory, so it runs on Local Repositories, Remote Repositories Caches, and Virtual Repositories.

From Artifactory 7.17.4, you can search within remote repositories.

Here are a few simple examples:

// Return all artifacts of the "artifactory" build.
items.find({"@build.name":{"$eq":"artifactory"}})
 
// Return all builds that have a dependency with a license that is not Apache.
builds.find({"module.dependency.item.@license":{"$nmatch":"Apache-*"}})
 
// Return all archives containing a file called "org/artifactory/Main.class".
items.find({"archive.entry.name":{"$eq":"Main.class"} , "archive.entry.path":{"$eq":"org/artifactory"}})

Here is a slightly more complex example:

// Return all entries of any archive named "Artifactory.jar" from any build named "Artifactory" with 
// build number 521.
archive.entries.find( {
                "archive.item.name":{"$eq":"Artifactory.jar"},
                "archive.item.artifact.module.build.name":{"$eq":"Artifactory"},
                "archive.item.artifact.module.build.number":{"$eq":"521"}
})

Here is another example that shows the full power of AQL to mine information from your repositories in a way that no other tool can match:

// Compare the contents of artifacts in 2 "maven+example" builds  
items.find(
        {
                "name":{"$match":"multi2*.jar"},
                "$or":[
                        {
                                "$and":[
                                        {"artifact.module.build.name":{"$eq":"maven+example"}},
                                        {"artifact.module.build.number":{"$eq":"317"}}
                 ]
            },
            {
                "$and":[
                        {"artifact.module.build.name":{"$eq":"maven+example"}},
                    {"artifact.module.build.number":{"$eq":"318"}}
                 ]
            }
          ]
}).include("archive.entry")

For detailed information about AQL, refer to the following topics: