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>

提交代码后,编译通过。

猜你喜欢

转载自blog.csdn.net/zzyzenith/article/details/84104125