I'm new to Maven and trying to work out how to deal with a situation where I have a set of binary libraries (.jars) that I want to include in multiple Maven-managed projects.
The libraries don't have a pom.xml file and aren't available in any Maven repository.
How should I set up Maven / m2eclipse to include these libraries in my other projects? I'm assuming I need to set up some kine of Maven "wrapper project" to deal with these?
If you're team programming use @limc post.
If it's just for you, there are a couple of ways of dealing with it:
There's a maven plugin to add the jar to your local repository.
mvn install:install-file -DgroupId=<your_group_name> \
-DartifactId=<your_artifact_name> \
-Dversion=<snapshot> \
-Dfile=<path_to_your_jar_file> \
-Dpackaging=jar \
-DgeneratePom=true
Or you can reference the jar file as a system dependency like so:
<dependency>
<groupId>com.package</groupId>
<artifactId>id</artifactId>
<version>5.2</version>
<scope>system</scope>
<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/my.jar</systemPath>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With