1.在控制(controller)层的pom.xml文件中加上
<!--打包配置-->
<build>
<plugins>
<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>xxx.xxx.xxx.ApiApplication</mainClass>
</configuration>
</plugin>
</plugins>
</build>
- 然后重新打包,放到服务器上,启动OK !!!