Add jar to Maven project without installing to repository 

Joined:
08/13/2009
Posts:
172

February 10, 2012 14:41:03    Last update: February 10, 2012 14:44:01
I wanted to add a jar file to a Maven project but I don't want to create an artifact and install it to the repository. This is a third party jar that will be used only for this project and not shared with other projects, so it's convenient just to drop it in the project folder and package it with the target.

Maven provides the system dependency scope to do just that:
<dependency>
    <groupId>com.thirdparty</groupId>
    <artifactId>make-up-artifact-id</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/lib/third-party.jar</systemPath>
</dependency>
Share |
| Comment  | Tags