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包結束。
不足之處還請指正。