SpringBoot在install时报错Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.9.

我的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>

版权声明:本文为weixin_59744818原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。