错误如下:
Unable to find a single main class from the following candidates
详细如下:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.0.M4:repackage (default) on project demo-rpc-server: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.2.0.M4:repackage failed: Unable to find a single main class from the following candidates [com.hello.demo.rpc.server.DemoServerStarter, com.hello.demo.rpc.server.common.testMain] -> [Help 1]
![](https://img.laitimes.com/img/9ZDMuAjOiMmIsIjOiQnIsIyZuBnL5cDO2UzM0kTM1IjNwkTMwIzLc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
原因就是项目中除了启动类的main之外还有一个我自己写的测试类testMain,把自己的测试主类注释或删除就好了。