1、打包时测试类异常
常见error: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project product-client: There are test failures. [ERROR]
解决方案:
使用插件,在相应pom.xml文件里面,修改
<plugin>
<groupId>org.apache.maven.plugins
<artifactId>maven-surefire-plugin
<testFailureIgnore>true
</plugin>
2、打包时找不到mainClass
常见Error:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.3.RELEASE:repackage (default) on project webapps-api-bid: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.5.3.RELEASE:repackage failed: Unable to find main class
解决方案:
1、配置主类程序入口,并添加@SpringBootApplication注解。
2、注释掉pom里面的
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactld>
</plugin>
网友评论