Local repository modules are useful when your project depends on some jars that cannot be found in any public or proprietary repository. In such cases, you have two choices: importing the jar in your local repository manually before running the build, as suggested in the mvn faq, or make your build process do it for you automatically; this is how: A Maven-friendly Pattern for Storing Dependencies in Version Control.
I learned this "pattern" time ago working with Greg in a company that was not using maven, so didn't had any repository for proprietary libraries. The solution was working great automating the process of installing the proprietary jars into the local repositories, and was saving developers to execute many maven esoteric command lines to import jars one by one.
To deploy files in a local repository module, it's possible to use the goal "deploy:deploy-file" as indicated in the example here:
mvn deploy:deploy-file -Durl=file://C:\m2-repo \
-Dfile=your-artifact-1.0.jar \
-DgroupId=org.some.group \
-DartifactId=your-artifact \
-Dversion=1.0 \
-Dpackaging=jar \
-DgeneratePom=true
I promised to myself to write an howto about this interesting topic, as it may be useful to myself in future and I need an online reference to this procedure. But recently I don't have much time to blog, so I have to reference an existing article.
Another reference: a feature request opened by Greg to Maven team MNG-3989.
One Response to “Maven Local Repository Modules”
Leave a Reply
Search
Calendar
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Jul | Sep » | |||||
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 | |||||
Follow me
Archives
Categories
- Android (3)
- Apple (29)
- Books (7)
- Eclipse (14)
- Errors (5)
- Firefox (7)
- Git (3)
- Hardware (18)
- Horror Code (8)
- Internet (21)
- Java (104)
- JavaScript (9)
- Life, universe and everything (45)
- Lifehacks (26)
- Linux (52)
- Opinions (26)
- OSX (11)
- OWNER API (2)
- Python (1)
- Software (33)
- Speeches and Conferences (8)
- Unix (5)
- Web (23)
- Windows (19)
Tag Cloud
Android apple architecture Bash configuration CSS Development Düsseldorf Eclipse Git Google Hardware hdr How-To howto Java JAXB job Karmic Linux lion MacBook music Open Source Opinion OSX os x patterns Pitfalls Practices Resume Security Software Suspend TDD Testing tip tonemapped Tricks Ubuntu unix video Web Workaround XML
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
Blog License
Blogs I like
Books on the desk
Friends' Blogs
- Antonio Terreno & Valter Bernardini
- Bruno Bossola
- Daniele Galluccio
- Domenico Ventura
- Ed Schepis
- Fabrizio Gianneschi
- Luca Grulla
- Luigi Zanderighi
- Marcello Teodori
- Mida Boghetich
- Muralidharan Chandrasekaran
- Piero Ricca
- Renzo Borgatti
- Simone Bordet
- Simone Bruno
- Uberto Barbini
- Valvolog
- Webtide blogs (Greg Wilkins & Jan Bartel)
Links


















Or third (deprecated) option, you could use scope=system and systemPath=${basedir}/more_libs/xxx.jar in your dependency and put the libs under version control so that none is forced to manually download and install the dependency. Brett Porter’s idea, however, is a cunning one, guess I’ll put it to work very soon.