How to add a local lib directory to Maven
Sometimes there is a dependency not available at a remote repository and one is too lazy to set up a local maven repository – that’s when one adds a directory in the project structure and wants maven to find dependencies there.
- Create a directory called “lib” in the project root
- Add the following markup to the pom.xml inside the <repositories>-Tag:
<repository> <id>lib-repo</id> <name>lib-m2-repository</name> <url>file://${basedir}/lib</url> <layout>legacy</layout> <snapshots> <enabled>false</enabled> </snapshots> <releases> <checksumPolicy>ignore</checksumPolicy> </releases> </repository>
Tags: Build, deployment, Development, Java, maven, repository