How to upload multiple maven artifacts(.zip) to different targets in Jfrog Artifactory using Jenkins pipeline script
Asked
Active
Viewed 1,719 times
0
2 Answers
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
-
It looks something like below def uploadSpec = """{ "files": [ { "pattern": "bazinga/*froggy*.zip", "target": "bazinga-repo/froggy-files/" } ] }""" server.upload(uploadSpec) – itgeek May 27 '18 at 22:28
-
What "looks something like below"? – J Fabian Meier May 28 '18 at 06:27