Search code examples
javamavendeploymenttools.jar

How to deploy tools.jar into Nexus using Maven?


From the same directory I tried to deploy spark-assembly-1.6.2.2.5.0.0-1245-hadoop2.7.3.2.5.0.0-1245.jar and tools.jar (the later being a dependency of the first) Despite launching the same commands:

mvn deploy:deploy-file -Dfile=./spark-assembly-1.6.2.2.5.0.0-1245-hadoop2.7.3.2.5.0.0-1245.jar -DgroupId="spark.yarn.jar" -DartifactId="spark-assembly-1.6.2.2.5.0.0-1245-hadoop2.7.3.2.5.0.0" -Dversion="1245-SNAPSHOT" -Dpackaging="jar" -DrepositoryId="stmms-id" -Durl="http://nexus.some.dns.com:8090/repository/maven-snapshots"

mvn deploy:deploy-file -Dfile=./tools.jar                                                      -DgroupId="jdk.tools"      -DartifactId="jdk.tools"                                             -Dversion="1.7.0_07"      -Dpackaging="jar" -DrepositoryId="stmms-id" -Durl="http://nexus.some.dns.com:8090/repository/maven-snapshots"

the first is successfull but the second fails: I also tried maven-deploy-plugin but with no much success.


Solution

  • Your repository maven-snapshots is a SNAPSHOT repository. You can only deploy SNAPSHOT versions to it.

    So -Dversion="1245-SNAPSHOT" is ok, but -Dversion="1.7.0_07" is not.