1. 程式人生 > >SpringBoot 編譯時出現Unable to find a single main class的解決方法

SpringBoot 編譯時出現Unable to find a single main class的解決方法

今天一個Maven專案突然jenkins編譯不通過了,報錯內容如下:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.6.RELEASE:repackage (default) on project quickpass-trafficcard-common: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.3.6.RELEASE:repackage failed: Unable to find main class -> [Help 1]

解決方法:找不到main方法,就在pom.xml中指定main class的位置:

 <properties>
       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
       <start-class>com.XXXXXX.tsp.pump.PumpBootstrap</start-class>
 </properties>

提交程式碼後,編譯通過。