Sometime ago I saw me before a situation that I've never had passing before. I needed use my local lib on Java maven project.
To do that I followed the steps:
Step One: Put in my local library into maven repository
mvn install:install-file -Dfile=home/victor/dev/Example.jar -DgroupId=br.com.example -DartifactId=Example -Dversion=1.0.0 -Dpackaging=jar
Step Two: Install maven dependencies
mvn clean install
Step Three: Use the library in the project
Add the pendency in the pom.xml file like that:
<dependencies>
...
<dependency>
<groupId>br.com.example</groupId>
<artifactId>Example</artifactId>
<version>1.0.0</version>
</dependency>
...
</dependencies>
That's it!
I hope this helps you.
Top comments (3)
Hm...if your local library is a maven project you can simply do that via:
mvn clean install
if your local library is NOT a maven project then you are right. What I don't understand is the step two...Install maven dependencies
?Hi Karl.
Alter you put your local lib in local maven repository you can execute
mvn clean install
to use the lib.The
Install maven dependencies
isn't line command.Very good! Congrats.