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

更换笔记本后Eclipse中Maven项目poi.xml及构建报错求助

解决Maven资源插件无法解析的问题

问题现象

更换笔记本电脑后,在Eclipse中打开旧项目的pom.xml时持续报错,项目无法运行,构建时提示:

Errors occurred during the build.
Errors running builder 'Maven Project Builder' on project 'scratchit'.
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6

解决步骤

  • 清理本地仓库失效文件
    找到本地Maven仓库路径(默认是~/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.6),删除整个2.6文件夹,清除损坏或未下载完成的插件文件。

  • 强制更新Maven项目
    右键项目 → Maven → Update Project...,勾选Force Update of Snapshots/Releases选项,点击OK,让Maven重新从仓库拉取插件及依赖。

  • 校验Eclipse的Maven配置

    1. 打开Window → Preferences → Maven → Installations,确认配置的Maven版本与原项目兼容,路径指向正确。
    2. 进入Maven → User Settings,检查settings.xml是否配置了正确的镜像源(包括原项目使用的私有镜像),确保文件路径无误。
  • 手动补全插件文件(网络受限场景)
    如果无法自动拉取,可手动下载maven-resources-plugin-2.6.jar和对应的pom.xml文件,放置到本地仓库的org/apache/maven/plugins/maven-resources-plugin/2.6路径下。

  • 升级插件版本(可选)
    若旧版本插件存在兼容性问题,可在项目pom.xml中指定更稳定的新版本,修改后重新更新项目:

    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
      </plugins>
    </build>
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.16 16:25:30