springcloud-1: 用官方的pom.xml配置添加依赖失败
2018-03-28 15:15
471 查看
在eclipse中用STS生成了一个springcloud应用,pom.xml的核心配置如下:
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.0.RELEASE</version> </parent> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Finchley.M9</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId></groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency> <dependency> <groupId></groupId> <artifactId>spring-cloud-starter-eureka</artifactId> </dependency> </dependencies><repositories> <repository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>https://repo.spring.io/libs-milestone</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories>
用mvn install命令,报错如下:
[ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework.cloud:spring-cloud-dependencies:pom:Finchley.M9 from/to spring-milestones (https://repo.spring.io/milestone): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target @ line 43, column 16 [ERROR] 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:jar is missing. @ line 29, column 15 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project net.common:eureka-server:1.0.0 (D:\develop\workspace\eureka-server\pom.xml) has 2 errors [ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework.cloud:spring-cloud-dependencies:pom:Finchley.M9 from/to spring-milestones (https://repo.spring.io/milestone): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target @ line 43, column 16 -> [Help 2] [ERROR] 'dependencies.dependency.version' for org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:jar is missing. @ line 29, column 15 [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
报的错误挺玄乎,好像和SSL有关,实际上就是说目标文件找不到。
经多方查找和测试,pom.xml中repositories改成如下,解决问题:
<repositories> <repository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>https://repo.spring.io/milestone</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>repository.springframework.maven.release</id> <name>Spring Framework Maven Release Repository</name> <url>http://maven.springframework.org/milestone/</url> </repository> <repository> <id>org.springframework</id> <url> http://maven.springframework.org/snapshot</url> </repository> <repository> <id>spring-milestone</id> <name>Spring Maven MILESTONE Repository</name> <url>http://repo.spring.io/libs-milestone</url> </repository> <repository> <id>spring-release</id> <name>Spring Maven RELEASE Repository</name> <url>http://repo.spring.io/libs-release</url> </repository> </repositories>
相关文章推荐
- spring spring-mvc mybatis jetty 的pom.xml依赖配置完整版
- 在pom.xml中添加Spring依赖
- 在pom.xml中添加Spring依赖
- pom.xml添加spring依赖,统一管理版本
- Maven+Mybatis+Spring配置之第一步:配置pom.xml依赖
- pom.xml 添加 JSON依赖的配置
- Spring Cloud (20) | Spring Cloud Bus 使用kafka消息总线、gitlab添加webhooks实现自动刷新配置
- Spring中c3p0连接池的配置 及JdbcTemplate的使用 通过XML配置文件注入各种需要对象的操作 来完成数据库添加Add()方法
- 常用pom.xml中的依赖配置
- Spring Cloud Config服务化后获取配置失败
- 传智播客 Spring学习 xml配置依赖注入
- Maven配置Spring+SpringMVC+MyBatis(3.2.2)Pom 以及 IntelliJ IDEA 怎样打开依赖视图
- maven pom.xml添加依赖的2种方法
- Spring Data+Hibernate+JTA 中pom.xml的配置
- Idear 创建maven web项目后在pom.xml里面添加依赖,但项目里没有jar包
- spring 依赖注入xml配置原理解析
- 关于spring boot的pom依赖配置方式
- Spring boot pom.xml和application.properties配置信息
- 《Spring-boot》pom.xml配置
- IDEA中添加各种依赖pom.xml文件内容