Add a local dependencies maven jar package record

The project depends on a jar maven package is available at a private warehouse development environment, you can not get to the deployment environment, so take the next jar package in the project directory, pom add local-dependent manner

1 by the scope: system incorporated

  The jar lib package bag on the root directory, add dependencies  

<dependency>
    <groupId>**</groupId>
    <artifactId>x</artifactId>
    <version>2.2-SNAPSHOT</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/lib/**.x.2.2-SNAPSHOT.jar</systemPath>
</dependency>

This way is not feasible , since the scope: system and scope: system-dependent effect of the same range, i.e. for compiling and testing CLASSPATH effective, invalid runtime

2 jar package into the local repository

  command:    

mvn install:install-file -Dfile=/../lib/**.x.2.2-SNAPSHOT.jar -DgroupId=** -DartifactId=x -Dversion=2.2-SNAPSHOT -Dpackaging=jar

  pom-dependent

<dependency>
    <groupId>**</groupId>
    <artifactId>x</artifactId>
    <version>2.2-SNAPSHOT</version>
</dependency>

  This can can be loaded into the compile, test, run

Guess you like

Origin www.cnblogs.com/xingjj/p/11512124.html