Monday, October 02, 2006

Using Maven's deploy:deploy-file to import 3rd party jars

Maven - Guide to deploying 3rd party JARs to remote repository

Usually I just manually copy in third party jars to our Maven repository when they come by, but recently I decided to give Maven's own tools a try. In this example, I'm deploying a MyLEAD jar Scott Jensen has sent my way:


mvn deploy:deploy-file -DgroupId=mylead -DartifactId=mylead-crosscut-attr \
-Dversion=1.0 -Dpackaging=jar -Dfile=./mylead_crosscut_attr-1.0.jar \
-Durl=scpexe://rainier.extreme.indiana.edu/l/extreme/java/repository

And here, I deploy it again, but this time as a Maven1 type artifact, to support Maven1 clients:


mvn deploy:deploy-file -DgroupId=mylead -DartifactId=mylead-crosscut-attr \
-Dversion=1.0 -Dpackaging=jar -Dfile=./mylead_crosscut_attr-1.0.jar \
-Durl=scpexe://rainier.extreme.indiana.edu/l/extreme/java/repository \
-DrepositoryLayout=legacy

2 comments:

Unknown said...

There is a bug with Maven 2.0.4's deploy:deploy for 3rd party jars. You have to drop back to 2.0.2.

Marcus Christie said...

Marlon and I exchanged a couple of emails and he's getting an error when doing this with 2.0.4. I haven't had any such problems, however.