將build中的入口改為如下即可解決:
<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>
注意:
execution中內容很重要