Java Ninja Chronicles By Norris Shelton

Things I learned in the pursuit of code

Every once in a while, you have a library that isn’t in a repository and shouldn’t be there for some reason. We had such a library. How do you use that library when it is on your local system instead of in a repository? Use the system scope.

<dependency>
      <groupId>com.this.and.that</groupId>
      <artifactId>non-repo-library</artifactId>
      <version>1.0</version>
      <scope>system</scope>
      <systemPath>/my/path/to/lib.jar</systemPath>
    </dependency>

System scope tells Maven that the dependency is on the file system. System Path tells Maven where to find the dependency.

December 10th, 2014

Posted In: Maven

Tags: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

LinkedIn Auto Publish Powered By : XYZScripts.com