在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>
本文详细介绍如何在Maven的pom.xml文件中配置spring-boot-maven-plugin插件,通过设置mainClass属性来指定项目的主类,实现Spring Boot应用的一键打包。特别强调在多模块项目中正确配置的重要性。
1203

被折叠的 条评论
为什么被折叠?



