BUG背景:
今天在构建一个maven父子工程,但是在使用mvn clean install -DskipTests打包命令之后,就出现了一个BUG
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.5.RELEASE:repackage (repackage) on project dubbo-spring-cloud-api: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.3.5.RELEASE:repackage failed: Unable to find main class -> [Help 1]
看bug的提示信息中意思是:没有找到主方法类
解决方案:
查看一下最外层的父工程pom文件中,是否存在如下maven插件的代码:
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
如果存在该代码,把父工程的这段代码去掉之后再mvn打包即可