使用 Gradle 时获取 Spring boot 源代码

Ari*_*deh 5 java gradle

我正在使用 gradle 来管理我的 Spring boot 项目。我希望能够通过 Spring 类的源代码进行调试。

有没有办法告诉 gradle 沿着 jar 文件下载源代码?

更新 1 我添加classifier: 'sources'到 gradle 属性文件:

compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version:'1.5.8.RELEASE', classifier: 'sources'

在 Eclipse 中,我刷新了 gradle 项目,但是当我想在 spring 源代码中调试时,仍然出现 Source not found 错误。

更新 2 我将以下内容添加到 gradle 属性文件中:

apply plugin: 'java'
apply plugin: 'eclipse'

eclipse {
    classpath {
        downloadJavadoc = true
        downloadSources = true
    }
}
Run Code Online (Sandbox Code Playgroud)

并运行gradle cleanEclipse eclipse,但我仍然无法在 spring 源代码中进行调试。