文中方法为: 分离第三方lib包!!!
1. 以正常方式打包Jar,并用压缩软件打开,在 BOOT-INF 目录下找到 lib 文件夹,将其复制出来(如图)

2. 打开你的 pom.xml 文件找到 spring-boot-maven-plugin ,修改为如下配置:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layout>ZIP</layout>
<includes>
<include>
<groupId>nothing</groupId>
<artifactId>nothing</artifactId>
</include>
</includes>
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
</configuration>
</plugin>
3. 现在使用maven打包就会发现jar包的大小只有几m,运行的命令没什么区别,加个参数加载之前的lib文件夹即可
java -Dloader.path="lib" -jar ruoyi.jar
最新回复