Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mvn deploy:deploy-file publish multiple files to nexus

We want to publish the artifacts using mvn command to the "release" repository in nexus (not SNAPSHOT), however running multiple commands to add new files to one of the version isnt possible (will fail with HTTP 400 error). So, can any one please share pom.xml where we can publish multiple files in one shot to nexus release repository ?

I have been trying to execute below 3 commands and 1st one succeeds and 2nd command fails

mvn deploy:deploy-file -DgroupId=com.jdk.mid-openjdk -DartifactId=jre -Dclassifier=windows-x86-64 -DrepositoryId=devsnc-releases -Dversion=11.0.8-ga -DgeneratePom=true -Dpackaging=zip -Durl=http://nexus/content/repositories/releases -Dfile=jre-jdk-11.0.8-hk-windows-x86-64.zip -DgeneratePom=true
mvn deploy:deploy-file -DgroupId=com.jdk.mid-openjdk -DartifactId=jre -Dclassifier=linux-x86-64 -DrepositoryId=devsnc-releases -Dversion=11.0.8-ga -DgeneratePom=true -Dpackaging=zip -Durl=http://nexus/content/repositories/releases -Dfile=jre-jdk-11.0.8-hk-linux-x86-64.zip -DgeneratePom=true
mvn deploy:deploy-file -DgroupId=com.jdk.mid-openjdk -DartifactId=jre -Dclassifier=windows-x86-32 -DrepositoryId=devsnc-releases -Dversion=11.0.8-ga -DgeneratePom=true -Dpackaging=zip -Durl=http://nexus/content/repositories/releases -Dfile=jre-jdk-11.0.8-hk-windows-x86-32.zip -DgeneratePom=true
like image 344
hare krshn Avatar asked Oct 15 '25 19:10

hare krshn


2 Answers

You can use classifiers instead of classifier and files instead of file. Then you can first give the list of classifiers and then the list of files to upload.

See also:

https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html

like image 121
J Fabian Meier Avatar answered Oct 18 '25 09:10

J Fabian Meier


It works example:

C:\Tools\apache-maven-3.9.6-bin\apache-maven-3.9.6\bin\mvn deploy:deploy-file -DgroupId=de.cenit.phoenix -Dtypes=bin,bin,bin -Dclassifier=windows -Dclassifiers=linux-x86_64,aix,linux-s390x -DartifactId=installer-agent -Dversion=5.6.0.0-000-MM_TestOps_Development-SNAPSHOT -Dfile=Agent_Installer-windows.exe -Dfiles=Agent_Installer-linux-x86_64.bin,Agent_Installer-aix.bin,Agent_Installer-linux-s390x.bin -DgeneratePom=true -DupdateReleaseInfo=true -Durl="http://user:pwd@server:8081/nexus/repository/eimrd-snapshot"

like image 33
mike Avatar answered Oct 18 '25 09:10

mike



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!