1、引入模块下的jar
1.负责打包的模块,pom中加上这个插件,这个可以把外部jar包打入工程中。
<!-- 打包 -->
<build>
<finalName>xxx-send-admin</finalName>
<resources>
<resource>
<directory>${project.basedir}/lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
<!--将src/main/resources下的文件打包进去,否则运行jar程序会报错不能启动-->
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
<!-- 跳过单元测试 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
2.应用jar包的模块pom
<dependency>
<groupId>com.fin-framwork</groupId>
<artifactId>fin-framework-client-1.0.0-SNAPSHOT</artifactId>
<version>1.0.0</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${project.basedir}/lib/fin-framework-client-1.0.0-SNAPSHOT.jar</systemPath>
</dependency>
3.Jar包位置图

2、引入非本模块下的jar
<dependency>
<groupId>com.aa.bb</groupId>
<artifactId>xxxx-client</artifactId>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/xxxx-client-1.0.0.jar</systemPath>
<version>1.0.0</version>
</dependency>