java - 无法在 Eclipse IDE 中下载 CrudRepository 源 - 未找到源

标签 java eclipse maven

通常,当我 Ctrl + 单击 Spring Tool Suite 中如下所示界面中的 CRUDRepository 时,会自动下载源代码。

public interface StudentImpl extends CrudRepository<Student, Integer>

但是当我在 eclipse 上尝试这个东西时它不起作用。它确实可以在我同事的电脑上运行。如何通过 Ctrl + 单击来下载源代码?目前我正在研究 Spring Boot。我在下面添加了首选项屏幕截图:

RE @nhu:我尝试过做同样的事情,但它没有下载任何东西。

enter image description here

enter image description here

Source not found The JAR file Z:\Users\ASharma20.m2\repository\org\springframework\data\spring-data-commons\2.0.6.RELEASE\spring-data-commons-2.0.6.RELEASE.jar has no source attachment.

You can attach the source by clicking Attach Source below:

最佳答案

有时会去 maven --> 下载源代码不起作用并且永远不会下载源代码。

为此,我们需要额外的步骤,如下所示:

  1. 从您尝试下载源代码的 .m2 文件夹中删除 jar
  2. 使用 maven 重新下载 jar --> 更新项目 --> 强制更新快照

enter image description here

enter image description here

  • 现在您可以重复相同的步骤(maven --> 下载源)。这次它将下载源码!
  • enter image description here

    关于java - 无法在 Eclipse IDE 中下载 CrudRepository 源 - 未找到源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50176924/

    相关文章:

    java - 将家长文档包含到 zip 文件中

    java - Ubuntu中eclipse 3.8安装maven

    java - 如何防止在数据库中快速连续创建重复条目? (日本公共(public)事务局)

    java - 使用WindowBuilder + Scala,有什么好的想法吗?

    java - 在默认包中的 JAR 文件中导入类

    java - Hadoop:Eclipse 列表之外丢失数据

    java - springMVC中的Httpsession管理

    java - 当重写一个方法时,我们不是重写整个方法吗?我尝试覆盖 java.awt.Container.paint

    java - 获取 Facebook 用户数据

    java - 尝试在 Windows 10 计算机上运行时出现 Maven 错误