JAVA STUFF
JAVA STUFF
How to reference a project local jar in maven
tirsdag den 3. november 2009
Sometimes you have a 3. party jar that you want to use in your project, but it’s not available in public maven repository, and you don’t want to manually install it in your local maven repository.
Luckily Maven supports referencing 3. party Jars from a folder on your machine.
I typically put the 3. party jars in a /lib folder inside the project that needs the jar, so I can reference its path relatively.
Here’s how you would reference a mongo db jar placed in the projects lib folder (right under the projects root folder).
One thing to note is that until Maven 2.2.2 get released then dependencies defined this like wont work transitively. Maven simply fails when resolving the dependency in another project that depends on the project in which this system dependency is defined.