简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM