10

I'm stumped trying to deploy an artifact, its sources and its javadoc to our maven repository (Nexus). The sources and javadoc parameters seems to be ignored, and only the main jar specified in -Dfile is actually uploaded.

Does anyone know what's wrong? Here's my command (I'm trying to put Whack into our local repository)

mvn deploy:deploy-file -Dfile=whack-1.0.0.jar \ 
                       -Dsources=whack-1.0.0-sources.jar \
                       -Djavadoc=whack-1.0.0-javadoc.jar \
                       -DgroupId=org.igniterealtime \                     
                       -DartifactId=whack \
                       -Dversion=1.0.0 \
                       -Dpackaging=jar \
                       -Durl=https://myhost.com/nexus/content/repositories/thirdparty/  
Miquel
  • 15,405
  • 8
  • 54
  • 87
  • By the way, I am aware that I can use the Nexus web interface to upload an artifact and everything that goes with it. I just would like to do it from the command line. – Miquel Sep 20 '11 at 15:04

2 Answers2

15

First check if you are using plugin version 2.7. According documentation the option sources and javadoc are available from this version on.

If you using the correct version and it still doesn't work you can deploy the artifacts using old way - in multiple command.

To deploy source jar use:

mvn deploy:deploy-file -Dfile=whack-1.0.0-sources.jar \
                       -Dclassifier=sources
                       -DgroupId=org.igniterealtime \                     
                       -DartifactId=whack \
                       -Dversion=1.0.0 \
                       -Dpackaging=jar \
                       -Durl=https://myhost.com/nexus/content/repositories/thirdparty/

and javadoc jar:

mvn deploy:deploy-file -Dfile=whack-1.0.0-javadoc.jar \
                       -Dclassifier=javadoc
                       -DgroupId=org.igniterealtime \                     
                       -DartifactId=whack \
                       -Dversion=1.0.0 \
                       -Dpackaging=jar \
                       -Durl=https://myhost.com/nexus/content/repositories/thirdparty/
amra
  • 16,125
  • 7
  • 50
  • 47
  • Ok, so classifier is what I was missing.. And yeap, I'm using version 2.5 of the plugin.. Thanks! – Miquel Sep 23 '11 at 09:08
1

you need to additionally specify the -DrepositoryId

pavel
  • 21
  • 1