Maven存储库具有无效的证书 [英] maven repository has an invalid certificate
问题描述
我尝试使用对plateform-bom的依赖
I try to use the dependency on plateform-bom
<dependency>
<groupId>io.spring.plateform</groupId>
<artifactId>plateform-bom</artifactId>
<version>1.0.1-RELEASE</version>
<type>pom</type>
scope>import</scope>
</dependency>
所以我添加了Spring的存储库
so I add the repository of Spring
<repository>
<id>spring-repo</id>
<name>Spring Maven Repository</name>
<url>https://repo.spring.io/release/</url>
</repository>
,但是存储库没有有效的证书,因此maven拒绝使用它. 是否有一个http而不是https的存储库,或者您可以在存储库中放置一个有效的证书吗? 最好的问候
but the repository has a no valid certificate so maven refuse to use it. Is there a http instead of https repository or could you put a valid certificate on your repository ? Best regards
这是mvn命令的结果:
here is the result of mvn command:
mobo7205@ubuntu:~/NetBeansProjects/plateform/test/test-frontend$ mvn clean install
[INFO] Scanning for projects...
Downloading: https://maven.springframework.org/release/io/spring/plateform/plateform-bom/1.0.1-RELEASE/plateform-bom-1.0.1-RELEASE.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.orange.test:test-frontend:1.0.0-SNAPSHOT (/home/mobo7205/NetBeansProjects/plateform/test/test-frontend/pom.xml) has 2 errors
[ERROR] Non-resolvable import POM: Could not transfer artifact io.spring.plateform:plateform-bom:pom:1.0.1-RELEASE from/to spring-repo (https://maven.springframework.org/release): hostname in certificate didn't match: <maven.springframework.org> != <repo.springsource.org> OR <repo.springsource.org> @ com.orange.test:test:1.0.0-SNAPSHOT, /home/mobo7205/NetBeansProjects/plateform/test/pom.xml, line 111, column 25 -> [Help 2]
[ERROR] 'dependencies.dependency.version' for org.springframework:spring-core:jar is missing. @ line 63, column 21
[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
推荐答案
由于过时的Maven版本,我遇到了这个hostname in certificate didn't match
问题,该版本的 HttpComponents 依赖项不适用于SNI SSL证书
I ran into this hostname in certificate didn't match
problem because of an outdated Maven version, whose HttpComponents dependencies don't work with SNI SSL certificates.
一旦我更新了Maven(大概任何比Maven 3.2.5更好的东西都应该可以工作),一切都会恢复正常.
Once I updated Maven (presumably anything better than Maven 3.2.5 should work), everything worked well again.
这篇关于Maven存储库具有无效的证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!