0

How to upload multiple maven artifacts(.zip) to different targets in Jfrog Artifactory using Jenkins pipeline script

metalisticpain
  • 2,698
  • 16
  • 26
itgeek
  • 549
  • 1
  • 15
  • 33

2 Answers2

2

If your using the Jenkins artifactory plugin, this grants access to the Jfrog Cli which enables use of uploadSpec and downloadSpec. (Artifactory.server name is configured under jenkins global settings after installing artifactory plugin)

def server = Artifactory.server 'artifactory'
def uploadSpec = """{
                     "files": [
                                {
                                "pattern": "*-file-1.zip",
                                "target": "location1/1"
                                },
                                {
                                "pattern": "*-file-2.zip",
                                "target": "location2/2"
                                }
                            ]
                        }"""
def buildInfo = server.upload(uploadSpec)

More info on filespecs available on their website https://www.jfrog.com/confluence/display/RTF/Using+File+Specs

metalisticpain
  • 2,698
  • 16
  • 26
0

You can use the Maven deploy:deploy-file goal (http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html) to upload arbitrary files.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142