我的SpringBoot项目,将一个子模块common在install时报错:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.9.RELEASE:repackage (repackage) on project u-common: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.3.9.RELEASE:repackage failed: Unable to find main class
根据Unable to find main class猜测原因是子模块中没有启动类,而父项目的pom.xml中有spring-boot-maven-plugin,导致报错,果然,将这段代码注释掉后就install成功。
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>