How to Upload Multiple Artifacts to artifactory along with their folder structure using Jfrog CLI

Viewed 285

I need to upload all the artifacts generated as part of the build to artifactory based on its folder structure.

Here folder structure is nothing but group id, version and artifact id was mentioned at pom level in case of all the dependencies.

So the expectation is how to mention that folder structure in "jfrog rt upload" CLI command?

Because the folder structure will change for every artifact.

jfrog rt upload --flat=false "${dynamic folder structure}/*" p2-release-local/

As per our expectation artifacts should go like this,

http://<artifactorylink>/<group id>/<artifac id>/<version>/<.jar>

http://<artifactorylink>/<group id>/<artifac id>/<version>/<.pom> 

NOTE: Am using freestyle job in jenkins, so i cannot use the jfrog plugin to do this for me. And the plugins which are availalbe in freestyle job also will upload some artifacts even we need to provide group and artifact id for it. so it doesn't seems to be helping.

Please let me know how to could accomplish this expectation or if there is anyother way i could upload these artifacts to JFROG along with folder structure.

1 Answers

If you want to upload a folder and files in it using JFrog CLI, you may visit this confluence page for the complete details.

In short, you may use the below command.

jfrog rt u "root/test/(*)" p2-release-local/test/{1}

To apply the source path pattern for directories as well as files, add the include-dirs flag.

jfrog rt u --include-dirs=true "root/test/(*)" p2-release-local/folder/{1}
Related