天天看点

在Maven项目中使用本地JAR包

在Maven项目中使用本地JAR包有两种方法:

1. 使用system scope

<dependencies>
  <dependency>
  <groupId>com.baidu.ueditor</groupId>
  <artifactId>ueditor</artifactId>
  <version>1.1.2</version>
  <scope>system</scope>
  <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/ueditor-1.1.2.jar</systemPath>
  </dependency>
 </dependencies>      

system scope引入的包,在使用jar-with-dependencies打包时将不会被包含,可以使用resources将本地包打进jar-with-dependencies

mvn install:install-file -Dfile=ueditor.jar -DgroupId=com.baidu.ueditor -DartifactId=ueditor -Dversion=1.1.2 -Dpackaging=jar      

继续阅读