在 pom
文件的 build
标签加上 spring-boot-maven-plugin
插件即可。
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>=
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<includeSystemScope>true</includeSystemScope>
<mainClass>com.xxx.xxx.xxx</mainClass>
</configuration>
</plugin>