1

When I want to deploy 3rd jars to my nexus 3 repository I use this command:

mvn deploy:deploy-file
-Dfile=<path-to-jar>
-DpomFile=<path-to-pom>
-DrepositoryId=<id-to-map-on-server-section-of-settings.xml>
-Durl=<url-of-the-repository-to-deploy>

but this command works only on jars with pom, and there is many artifacts that have only pom without jar, so i am looking for a way to deploy only pom without a jar file. My maven version is 3.3.9

Ron Badur
  • 1,873
  • 2
  • 15
  • 34
  • did you tried without the *-Dfile* and is your pom have the packaging pom ? – Walfrat Dec 31 '16 at 15:45
  • my pom have the packaging pom, and when i remove the -Dfile i get an error - "the parameter file are missing or invalid" – Ron Badur Dec 31 '16 at 15:54
  • seems like you can do -Dfile=pom.xml see http://stackoverflow.com/a/40259503/5070577 – Walfrat Dec 31 '16 at 15:59
  • when I do -Dfile=pom.xml , I need to give the command 3 more parmaters: the groupId, artifactId and version. I solved this with adding -DpomFile= and -Dfile=, Thanks for your help – Ron Badur Dec 31 '16 at 16:31

1 Answers1

0
mvn deploy:deploy-file
-DgroupId=com.xxx.xxx.xxxx
-DartifactId=xxxxx
-Dversion=x.x.x
-DgeneratePom=false
-DrepositoryId=nexus 
-Dpackaging=pom
-Dfile=D:/xxx/xxxxx-x.x.x.pom
-DpomFile=D:/xxx/xxxxx-x.x.x.pom
-Durl=http://xxx.xx.xx.xx:8081/repository/thirdparty

-Dfile, is mandatory for Maven deploy-file. Therefore you have to specify a file.

In this case, you can point the same pom file for both -DpomFile and -Dfile.

This works in Nexus OSS version 3.23.0-03 with Maven 3.5.2

G 1
  • 643
  • 7
  • 18