简体   繁体   中英

Deploy Jar Artifact from Bamboo to Artifactory

I have defined a plan in bamboo that package a remote repository to a Jar file (Maven project). Basically this Jar is the first result I wanted to get from this plan. Now I would like to deploy this artifact to Artifactory, using the Artifactory Generic Deploy task. In this task, it has to be defined a Specs file specifying the pattern and target of this Jar.

This is the Specs file I defined :

{
  "files": [
   {
    "pattern": "${bamboo.build.working.directory}/target/*jars",
    "target": "https://artifactory.mycompany.com:443/sandbox/"
   }
  ]
}

I would like to deploy this Jar file into the repository I defined above (sandbox). The plan runs well but I don't see anything in this repository after its execution.

Is there something else to configure in this Specs file in order to obtain the behaviour I would like ? (basically push this artifact to a repository in Artifactory)

Thanks!

The value of the "target" property in the File Spec should not include a URL. It should include the upload path in Artifactory, starting with the target repository.

As for the "pattern" path, it starts from the current directory, which is the build plan's workspace, so if you'd like the "pattern" to pick up all the jar files in the "target" directory, the "pattern" value should be "target/*.jar".

So if you'd like to deploy all the jar files inside "target" to a local repository named "sandbox", the the File Spec should be:

{
  "files": [
   {
    "pattern": "target/*.jar",
    "target": "sandbox"
   }
  ]
}

Also make sure to select the Artifactory URL from the Generic Deploy tasks's UI.

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