Unable to find a single main class from the following candidates

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.2.7.RELEASE:repackage (default) on project kline-provider: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.2.7.RELEASE:repackage failed: Unable to find a single main class from the following candidates

 

Reason for the error: It turns out that this error is because maven will look for the main method in the project when executing packaging, and set it as the startup entry for Spring boot to generate the jar package, but at this time there are multiple main methods, and the maven plugin is at a loss. Hence this exception.

So commenting out the other useless main method solved the problem. It was kind of weird the first time I met it.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326485881&siteId=291194637