How do I deploy a file to Artifactory using the command line?

Andrew Prock picture Andrew Prock · Nov 19, 2013 · Viewed 55.5k times · Source

I've spent far more time on this than I care to admit. I am trying to just deploy one file into my Artifactory server from the command line. I'm doing this using gradle because that is how we manage our java builds. However, this artifact is an NDK/JNI build artifact, and does not use gradle.

So I just need the simplest gradle script to do the deploy. Something equivalent to:

scp <file> <remote>

I am currently trying to use the artifactory plugin, and am having little luck in locating a reference for the plugin.

Answer

diptia picture diptia · Jun 3, 2014

curl POST did not work for me . PUT worked correctly . The usage is

curl -X PUT $SERVER/$PATH/$FILE --data-binary @localfile

example :

$ curl -v --user username:password --data-binary @local-file -X PUT "http://<artifactory server >/artifactory/abc-snapshot-local/remotepath/remotefile"