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

Eclipse中无法通过Ctrl+Click下载CrudRepository源码——源码未找到

Fixing Ctrl+Click to Download Source for CrudRepository in Eclipse

I’ve run into similar frustrating issues before with Eclipse not pulling in source jars automatically, even when STS works flawlessly. Let’s walk through targeted fixes that usually resolve this:

  • Verify Eclipse’s core source download settings
    Head to Window > Preferences > Maven > Download Sources and ensure the "Download Artifact Sources" checkbox is ticked. Also, check Window > Preferences > Java > Editor > Hyperlinking to confirm "Open Declaration" is enabled—this is what powers the Ctrl+Click navigation to declarations.

  • Force a full Maven dependency refresh
    Right-click your project → Maven > Update Project. Check the box for "Force Update of Snapshots/Releases" and hit OK. This tells Eclipse to ignore cached dependencies and re-fetch everything, including source jars, from scratch.

  • Manually attach the source if automatic download fails
    If the above doesn’t work, locate the spring-data-jpa jar under your project’s Maven Dependencies folder. Right-click it → Properties > Java Source Attachment. You can either point it to a manually downloaded source jar or let Eclipse search for it via the "Workspace..." option.

  • Clean and rebuild your project
    Corrupted build artifacts often mess with source linking. Go to Project > Clean..., select your project, and click OK. Then run mvn clean install via the Maven build menu to rebuild everything fresh.

  • Check for workspace metadata corruption
    Sometimes Eclipse’s workspace metadata gets wonky. If all else fails, back up your workspace, delete the .metadata folder, restart Eclipse, and re-import your project. This is a last-resort fix but often clears persistent issues.

Also, double-check your pom.xml has the correct Spring Data JPA dependency (it should inherit from the Spring Boot parent if you’re using that, but confirmation never hurts):

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-jpa</artifactId>
</dependency>

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.26 11:04:48