Reputation: 1726
I am working with Artifactory version 5.2, with a maven2 repository configured as a smart repository to http://repo1.maven.org As such, any build launched by maven or gradle will request dependencies on the Artifactory server, and if the artifact has not been cached already, the smart repo will download the file from http://repo1.maven.org first, and then provide the content to the maven / gradle script. This works as intended, I cannot complain here.
However, I also need to download dependencies directly using jfrogcli, with a command looking like
jfrog rt dl maven2/com/google/guava/guava-parent/10.0.1/guava-parent-10.0.1.pom
And this doesn't work on a smart repository as far as I can tell.
[Info] Searching items to download...
[Info] Downloaded 0 artifacts.
The only workaround I found was to first request the artifact from the maven2 repository using direct download, and then use jfrog cli to download it from the maven2-cache repository
curl -H ... -X GET <server>/artifactory/maven2/com/google/guava/guava-parent/10.0.1/guava-parent-10.0.1.pom
jfrog rt dl maven2-cache/com/google/guava/guava-parent/10.0.1/guava-parent-10.0.1.pom
I am fairly sure I am missing something simple wrt. smart repositories and jfrog cli, but I couldn't find an easy answer. Any feedback is welcome.
Upvotes: 1
Views: 2163
Reputation: 20386
This is a known limitation of the JFrog CLI related to the way the download command was implemented.
Currently the CLI is first querying Artifactory using AQL (Artifactory Query Language) for a list of artifacts which should be downloaded. This is highly useful when you are downloading multiple artifacts using patterns.
However AQL currently does not support querying for artifacts which are not cached yet. This means that the CLI will not try to download files which are not cached.
Upvotes: 5