今天一个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>
提交代码后,编译通过。