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

Eclipse保存pom.xml时陷入Download sources and javadoc构建死循环如何解决

问题描述

我尝试保存pom.xml文件时,Eclipse陷入无限死循环,在将源码和javadoc关联至classpath的过程中,构建状态始终显示为Download sources and javadoc (Sleeping) OK。

问题状态截图

我的POM文件内容如下:

<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.sachindra</groupId>
    <artifactId>wwe</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>5.5.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>5.5.0</version>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-picocontainer</artifactId>
            <version>5.5.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-cucumber4</artifactId>
            <version>2.1.2</version>
        </dependency>
        <dependency>
            <groupId>net.masterthought</groupId>
            <artifactId>maven-cucumber-reporting</artifactId>
            <version>5.3.0</version>
        </dependency>
    </dependencies>
</project>

我的Maven设置配置如下:
Maven配置截图

解决方案

关闭自动下载配置

  • 打开Eclipse偏好设置,依次进入「Window」→「Preferences」→「Maven」
  • 取消勾选「Download Artifact Sources」和「Download Artifact Javadoc」选项,保存设置后重启Eclipse
  • 若后续需要单个依赖的源码,可右键对应依赖,选择「Maven」→「Download Sources」手动拉取

清理损坏的依赖缓存

  • 关闭Eclipse,进入本地Maven仓库目录,默认路径为~/.m2/repository(Windows系统为C:\Users\当前用户名\.m2\repository)
  • 删除io.cucumber、net.serenity-bdd、net.masterthought三个groupId对应的所有文件夹
  • 重启Eclipse,右键项目选择「Maven」→「Update Project」,勾选「Force Update of Snapshots/Releases」后确认
  • 等待依赖重新拉取完成后再修改pom.xml验证

升级M2E插件

旧版本Eclipse内置的Maven集成插件存在已知的源码下载死循环bug,可升级修复:

  • 打开「Help」→「Eclipse Marketplace」,搜索「Maven Integration for Eclipse」
  • 升级到最新稳定版后重启Eclipse即可

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.09.29 13:06:03