0
votes

I am creating 3 Artifacts (war) for Dev, Test and Prod Environment using Profiles as following:

clean install -P dev
cp target/ABC.war output/ABC-dev-${BUILD_NUMBER}.war

clean install -P test
cp target/ABC.war output/ABC-test-${BUILD_NUMBER}.war

clean install -P prod
cp target/ABC.war output/ABC-prod-${BUILD_NUMBER}.war

To execute this from Jenkins I am using Jenkins plugin "Invoke top-level Maven targets".

Once created all war's, I wants to deploy these to Artifactory!

I google a lot but didn't find anything regarding just deploy my artifacts to Artifactory.

Note: I am able to build and deploy my artifact with "clean deploy -P dev", but in that case I am not able to modify my artifact name. (Companies Artifactory doesn't allow to deploy without versioning enabled)

Any help would be highly appreciated. Thank you!

2

2 Answers

0
votes

You can use cURL to upload your war files to Artifactory.

$ curl -v --user username:password --data-binary @/local/path/to/war-file/ABC-dev.war -X PUT "http://org.artifactory.com/artifactory/repo_name/folder_name/ABC-dev-${BUILD_NUMBER}.war

"

0
votes

You can use JFrog CLI in order to publish different files to different locations base on a pattern. For example:

jfrog rt u "*dev*" "dev-repo/path/to/file"
jfrog rt u "*test*" "test-repo/path/to/file"

That was you don't have to know the exact file name and can use the pattern for uploading the files to the right location.

Is that what you are looking for?