You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SpringBoot 3.2.0-RC2父POM无法解析:报错405如何解决?

SpringBoot 3.2.0-RC2构建失败(405 Not Allowed)修复方案

问题描述

尝试使用SpringBoot 3.2.0-RC2版本,配置的pom.xml如下:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.2.0-RC2</version>
</parent>

<repositories>

    <!-- Main Maven repository -->
    <repository>
        <id>central</id>
        <url>https://repo.maven.apache.org/maven2</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>

    <repository>
        <id>repository.spring.milestone</id>
        <name>Spring Milestone Repository</name>
        <url>http://repo.spring.io/milestone</url>
    </repository>

</repositories>

项目构建失败,报错信息:

[ERROR]     Non-resolvable parent POM for com.example:example:0.0.1: 
Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:3.2.0-RC2 from/to repository.spring.milestone (http://repo.spring.io/milestone): 
Failed to transfer file: http://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-parent/3.2.0-RC2/spring-boot-starter-parent-3.2.0-RC2.pom. 
Return code is: 405 , ReasonPhrase:Not Allowed. and 'parent.relativePath' points at wrong local POM @ line 6, column 13 -> [Help 2]

错误原因

  1. HTTP协议已被禁用:Spring官方里程碑仓库不再支持HTTP访问,必须使用HTTPS协议,原配置中的http://repo.spring.io/milestone会触发405不允许访问的错误。
  2. 缺少插件仓库配置:Maven解析父POM时,除了依赖仓库,还需要配置插件仓库,否则可能导致部分插件依赖无法正常拉取。

修复后的pom.xml配置

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.2.0-RC2</version>
</parent>

<repositories>
    <!-- Main Maven repository -->
    <repository>
        <id>central</id>
        <url>https://repo.maven.apache.org/maven2</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
    <!-- Spring Milestone Repository (HTTPS) -->
    <repository>
        <id>repository.spring.milestone</id>
        <name>Spring Milestone Repository</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

<!-- 添加插件仓库配置 -->
<pluginRepositories>
    <pluginRepository>
        <id>repository.spring.milestone</id>
        <name>Spring Milestone Repository</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>

额外建议

  • 执行构建前,可清理本地Maven缓存并强制更新依赖:mvn clean install -U
  • 如果本地存在旧的HTTP仓库缓存,建议删除Maven本地仓库中对应SpringBoot里程碑版本的目录,避免缓存干扰

内容的提问来源于stack exchange,提问作者alexanoid

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 10:57:43