升级到新的Spring Boot版本时Maven构建错误

时间:2015-08-30 00:38:23

标签: maven spring-boot

我在STS中运行了Maven Spring Boot项目,该项目构建良好:

   <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.2.5.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

将上面的Spring Boot&#39版本更新为 1.3.0.M4 会导致:

[FATAL] Non-resolvable parent POM: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.3.0.M4 from/to IWS_Repo (https://build-devtools.fw.net/artifactory/repo/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and 'parent.relativePath' points at no local POM @ line 18, column 10

我在STS和命令行上都尝试过:同样的错误。

可能是什么问题?

2 个答案:

答案 0 :(得分:5)

与Spring Boot版本不同,Spring Boot里程碑未发布到Maven Central。它们只发布到repo.spring.io。

要从1.2.5.RELEASE(可从Maven Central获得)升级到1.3.0.M4(不是'),您需要在pom中添加一些额外的配置,以便Maven知道要查看repo.spring.io的里程碑存储库:

<repositories>
    <repository>
        <id>spring-milestones</id>
        <url>https://repo.spring.io/milestone</url>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>spring-milestones</id>
        <url>https://repo.spring.io/milestone</url>
    </pluginRepository>
</pluginRepositories>

答案 1 :(得分:0)

看起来您的存储库存在证书问题:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path

https://build-devtools.fw.net/artifactory/repo/

尝试直接进入Maven Central:&gt; http://repo1.maven.org/maven/

请参阅http://maven.apache.org/guides/introduction/introduction-to-repositories.html