Search code examples
command-linegradleartifactory

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


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.


Solution

  • 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"