Software Development

Point to local dependency in Maven using systemPath


Sometimes you may not have access to a repository and may need to go around it. If your colleagues have local copies of jar files needed to compile a whole Maven project, you may simply replace the content of your .m2 directory with theirs. But what if there was change to your pom.xml and none of you had fetched the updates/dependencies via Maven? Worse, you may not have direct access to their respective repositories.

If those dependencies (e.g., jar files)are found elsewhere, you may download them and modify your pom.xml to point to those local copies. Not really a good practice but something nice-to-know in case you need a short-cut.

Maven Dependency using systemPath

This is how your project structure would look like:

16-3-2016 10-36-09 AM


Got comments, or suggestions? Please visit our Facebook page!

You Might Also Like