jar包
jar包的路径在BOOT-INF\lib目录下
在resources文件夹下创建jar文件夹,将jar包粘贴进去。
进入pom文件加入
<dependency>
<groupId>com.jayZhou</groupId>
<artifactId>aaaa-client-sso</artifactId>
<version>1.0-1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/jar/aaaa-client-sso-1.0-1.0.jar</systemPath>
</dependency>
groupId,artifactId,version可随便写
还需要在最后面加上,打包的时候打进去
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--增加-->
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
</build>
至此成功引入jar包
war包
(本方法未尝试)
jar包在WEB-INF/lib目录下
需要在pom文件加入以下内容
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<webResources>
<resource>
<directory>src/main/resources/jar/</directory>
<targetPath>WEB-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
引用:
https://www.cnblogs.com/netcorner/p/10962981.html