You need to enable JavaScript to run this app. IntelliJ构建克隆Maven项目报spring-boot-maven-plugin依赖传输失败怎么办
优惠活动
大模型
产品
解决方案
定价
更多

IntelliJ构建克隆Maven项目报spring-boot-maven-plugin依赖传输失败怎么办

Maven构建时拉取spring-boot-maven-plugin:2.1.7.RELEASE失败解决方案

以下是按优先级排序的排查解决步骤:

1. 检查网络与代理配置

  • 确认本地网络未被防火墙、内网规则拦截Maven central仓库请求,内网环境优先使用公司内部私有Maven仓库。
  • 核对IntelliJ Maven代理配置:打开File > Settings > Build, Execution, Deployment > Build Tools > Maven > Importing,检查VM options for importer参数,需走代理的场景添加如下配置:
-DproxySet=true
-DproxyHost=代理地址
-DproxyPort=代理端口
# 如需认证补充以下两行
-DproxyUser=代理用户名
-DproxyPassword=代理密码

2. 配置国内Maven镜像源

国内访问官方central仓库网络不稳定是最常见诱因,可通过配置阿里云镜像解决:

  • 打开IntelliJ Maven设置页的User settings file对应的settings.xml文件,在<mirrors>节点下添加如下配置:
<mirror>
  <id>aliyunmaven</id>
  <mirrorOf>central</mirrorOf>
  <name>阿里云公共仓库</name>
  <url>https://maven.aliyun.com/repository/public</url>
</mirror>

保存后点击IntelliJ右侧Maven面板的刷新按钮重新同步依赖。

3. 清理本地损坏的依赖缓存

如果之前拉取依赖中断,本地会生成损坏的.lastUpdated文件导致重复拉取失败:

  • 打开Maven设置页的Local repository对应的本地仓库目录,进入org/springframework/boot/spring-boot-maven-plugin/2.1.7.RELEASE路径,删除该目录下所有后缀为.lastUpdated的文件,重新执行clean build即可。

4. 校验项目pom插件仓库配置

如果项目pom内配置了自定义插件仓库,确认对应仓库包含该版本插件,也可在pom文件中显式添加central插件仓库配置:

<pluginRepositories>
  <pluginRepository>
    <id>central</id>
    <url>https://repo.maven.apache.org/maven2</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </pluginRepository>
</pluginRepositories>

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.09 19:54:04