1、pom.xml加入以下配置
<packaging>jar</packaging>
2、
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <goals> <goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中 --> </goals> </execution> </executions> </plugin> </plugins> </build>
3、mvn clean -> mvn install -> mvn package