pom.xml 去除所有依赖
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> <layout>ZIP</layout> <includes> <include> <groupId>nothing</groupId> <artifactId>nothing</artifactId> </include> </includes> </configuration> </plugin>
启动命令
java -Dloader.path="lib/" -jar web.jar
把需要的包拷贝到固定目录下