Solve: Unable to find main class when the local maven repository SpringBoot multi-module project install -> [Help 1]

In the process of packaging a springboot api module to publish to a local warehouse, packaging error occurs
Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.6.RELEASE:repackage failed: Unable to find main class -> [Help 1]

 The cause of the error is the parent module api module included in this build plug-ins, all api module also inherited this plug-in, due to the plug-in is for, when the api module does not have this kind XXXspringbootApplication.class entrance the entrance class will Unable to find main class error.

Solution: The following code module to delete the parent pom file.

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

 

 



Guess you like

Origin www.cnblogs.com/wangxiaoqian/p/12404808.html
Recommended