1,在项目模块的src目录下创建 lib 文件,将要引用的jar包放到lib下
2,在该项目模块内的pom.xml内引入依赖
<dependency>
<groupId>xx.xx.xxx</groupId>
<artifactId>license</artifactId>
<version>4.6.0</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/lib/license-4.6.0.jar</systemPath>
</dependency>
3,在pom.xml中的plugins标签内添加本地的scope配置
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.3.RELEASE</version>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
4,打包的plugin配置
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<compilerArguments>
<extdirs>${project.basedir}/src/lib</extdirs>
</compilerArguments>
</configuration>
</plugin>
注:extdirs标签内填引用jar包的路径