在pom 中的,plugin 中 指定 mainClass 属性,暂时先这么处理。
如果你是多 moudle 项目一定要注意,不能再 顶层 parent pom 中添加 mainClass 。在你需要启动的 moudle 中添加。
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>cn.xx.xx.xx.xxAppApplication</mainClass>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>