Noel Yap
Noel Yap

Reputation: 19758

How to use Artifactory REST API to deploy new artifact using Groovy HttpBuilder?

http://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-DeployArtifact describes the REST API as:

PUT /libs-release-local/my/jar/1.0/jar-1.0.jar
{
"uri": "http://localhost:8080/artifactory/libs-release-local/my/jar/1.0/jar-1.0.jar",
"downloadUri": "http://localhost:8080/artifactory/libs-release-local/my/jar/1.0/jar-1.0.jar",
"repo": "libs-release-local",
"path": "/my/jar/1.0/jar-1.0.jar",
"created": ISO8601 (yyyy-MM-dd'T'HH:mm:ss.SSSZ),
"createdBy": "userY",
"size": "1024", //bytes
"mimeType": "application/java-archive",
"checksums":
{
        "md5" : string,
        "sha1" : string
    },
"originalChecksums":{
        "md5" : string,
        "sha1" : string
    }
}

How does one provide the contents of the file when using Groovy's HttpBuilder?

Upvotes: 1

Views: 3551

Answers (1)

JBaruch
JBaruch

Reputation: 22893

If you need to interact with Artifactory from Java (or Groovy for that matter), I suggest using Artifactory Java client.

If it misses some features you need, please let us know, we'll be glad to implement them.

If you still prefer to do it by yourself, take a look at the sources, that's exactly what we do.

Upvotes: 0

Related Questions