錯誤如下:
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,把自己的測試主類注釋或删除就好了。