Friday, November 23, 2012

An excellent solution for local dependencies with Maven projects

I found this tip on Heroku devcenter website.

https://devcenter.heroku.com/articles/local-maven-dependencies

In a few words, you add a "repo" directory to your project, deploy your artifact into this local repo and declare this repository in your pom.xml. Then, you can use your local jar as classic maven dependency.

Here is the example :

yourproject
+- pom.xml
+- src
+- repo
mvn deploy:deploy-file -Durl=file:///path/to/yourproject/repo/ -Dfile=mylib-1.0.jar -DgroupId=com.example -DartifactId=mylib -Dpackaging=jar -Dversion=1.0
It's just perfect! Thanks to the Heroku member who had this excellent idea!














5 comments:

Frédéric DESCHAMPS said...

L'idée n'est pas mauvaise mais les commits du repo doivent être bien maîtrisés s'il s'agit d'un projet d'équipe...
J'aurais tendance à dire que c'est une situation très spécifique...

Si l'utilisation de plusieurs projets locaux vient à se généraliser l'utilisation d'un gestionnaire de repo (Nexus ou autre) serait recommandé. ;)

Mais je note tout de même l'idée :)

tahir sumar said...

Most Popular and Famous Vehicles, Latest Speed Cars, Sports Cars Info and Pictures.
worldlatestvehicles.blogspot.com

sunny kumar said...

Online Earning opportunities to make money online from home, Internet Online Business want to make money easy now.
www.jobzcorner.com

bhawan kumar said...

Online Earning opportunities to make money online from home, Internet Online Business want to make money easy now.
www.jobzcorner.com

simashree said...

Thanks for the great information in your blog Selenium Training in Chennai