SpringBoot父子maven工程执行install出现各种错误总结
程序员文章站
2022-05-29 17:09:37
...
1.maven工程执行install出现:
[ERROR] 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-feign:jar is missing.
解决思路:maven官方已经将spring-cloud-starter-feign改成了spring-cloud-starter-openfeign,旧版本已经作废
<dependency>
<groupId>org.springframework.cloud</groupId>
<!-- <artifactId>spring-cloud-starter-feign</artifactId>-->
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
2.Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.5.RELEASE:repackage (default) on project xc-framework-common: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0.5.RELEASE:repackage failed: Unable to find main class:
解决思路父工程pom.xml改成:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.whm.SpringbootTestApplication</mainClass>
<classifier>exec</classifier>
</configuration>
</plugin>
3.Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project test-freemarker: There are test failures.
解决思路:在执行install模块的pom.xml加入如下依赖:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
上一篇: springmvc配置文件的三种放置路径
下一篇: node设置淘宝镜像源