1.修改打包方式为jar

<packaging>jar</packaging>

2.添加第三方依赖到pom文件

我的第三方依赖包在resources目录下的lib目录下(地址可以随便写,但是路径要正确)
<dependency>
<groupId>otc</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/otc-commons-logging-1.2.jar</systemPath>
</dependency>
3.修改plugin
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
如果找不到资源文件可以添加(视情况而定)
<!--<resources>
<resource>
<includes>
<include>**/*.properties</include>
<include>**/*.yml</include>
<include>**/*.xml</include>
</includes>
</resource>
</resources>-->

到此springboot携带第三方jar包打成jar包结束。

不足之处还请指正。

相关文章:

  • 2018-09-05
  • 2021-06-29
  • 2021-11-23
  • 2022-02-08
  • 2021-11-28
  • 2021-12-07
  • 2021-07-20
  • 2021-08-10
猜你喜欢
  • 2022-12-23
  • 2022-03-06
  • 2022-12-23
  • 2022-12-23
  • 2020-10-19
  • 2021-12-19
  • 2021-09-15
相关资源
相似解决方案