解决:因为我使用的aliyun的SpringBoot框架,所以在pom.xml文件生成的的文件是:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<mainClass>com.jiang.user_center.UserCenterApplication</mainClass>
<skip>true</skip>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
主要问题就是把Configuration那部分注释掉就行了:这样就能找到主题类:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<!-- <configuration>-->
<!-- <mainClass>com.jiang.user_center.UserCenterApplication</mainClass>-->
<!-- <skip>true</skip>-->
<!-- </configuration>-->
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>