打包时无法引入外部jar

有一些jar是我们自己引入的,但是本地开发的时候能找到,打包之后启动就提示找不到

idea的引入方法网上有不多介绍

之后在pom文件里加上带scope的那个dependency

plugins里加上 <includeSystemScope>true</includeSystemScope>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.1.RELEASE</version>
<configuration>
<includeSystemScope>true</includeSystemScope>
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
原文地址:https://www.cnblogs.com/michaelcnblogs/p/14716457.html