How do I create and deploy the build information JSON file via the REST API?

You can utilize the Build Upload REST API call to deploy build-info files to Artifactory. This will enable you to generate a build info JSON file (same as the plugin generates for your builds).

 

The REST-API query for deploying the build info file should look like the following:

curl -X PUT -uusername:password -H “Content-type: application/json” -T buildtest.json “http://host:8081/artifactory/api/build”

 

Generally, the minimum for a valid build info JSON file is version, name, number and started date. The most basic one with the above params + module and artifact should look like the following example:

{

“version” : “1.0”,

“name” : “myBuild”,

“number” : “129”,

“started” : “2014-03-31T16:24:42.116+0300”,

 

“modules” : [ {

“id” : “org.jfrog.test:multi:2.36-2-SNAPSHOT”,

“artifacts” : [ {

“type” : “pom”,

“sha1” : “a1ab9222c219ec885ce4374b77cc4bd93485c6c8”,

“md5” : “495a5e916f0e308a8ed4fc170e4d9136”,

“name” : “multi-2.36-2-SNAPSHOT.pom”

} ]

} ]

}


For more complicated builds, you might want to review your current build info files and create one with the same structure (dependencies etc..)