IntelliJ 无法下载 commons-lang3-3.12.0-sources

问题描述 投票:0回答:1

我没有看到任何关于

commons-lang
的快速文档。我进入反编译的 .class 文件并单击“下载源”并得到:

10:45:40 am: Executing 'ijDownloadSources5e1c23e0-5bf'...


> Task :ijDownloadSources5e1c23e0-5bf FAILED
Execution optimizations have been disabled for task ':ijDownloadSources5e1c23e0-5bf' to ensure correctness due to the following reasons:
  - Type 'IjDownloadTask' property 'collectionProvider' cannot be resolved:  Could not find commons-lang3-3.12.0-sources.jar (org.apache.commons:commons-lang3:3.12.0). Searched in the following locations:  file:/Users/rob.bram/.m2/repository/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0-sources.jar. Reason: An input file collection couldn't be resolved, making it impossible to determine task inputs. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#unresolvable_input for more details about this problem.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
1 actionable task: 1 executed

FAILURE: Build failed with an exception.

* Where:
Initialization script '/private/var/folders/58/4bhh_y2955x_rrk219q06r2w0000gp/T/ijDownloadSources8.gradle' line: 36

* What went wrong:
Execution failed for task ':ijDownloadSources5e1c23e0-5bf'.
> Could not resolve all files for configuration ':downloadSources_65dedda4-dd40-4228-8913-a0787c03f670'.
   > Could not find commons-lang3-3.12.0-sources.jar (org.apache.commons:commons-lang3:3.12.0).
     Searched in the following locations:
         file:/Users/rob.bram/.m2/repository/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0-sources.jar

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 318ms
10:45:41 am: Execution finished 'ijDownloadSources5e1c23e0-5bf'.

我有这个在

build.gradle

apply plugin: 'idea'
idea {
    module {
        excludeDirs += files("node_modules")
        downloadJavadoc = true
        downloadSources = true
    }
}

我确实看到了有关其他 API 的快速文档。很难弄清楚这个有什么问题。

gradle intellij-idea build.gradle apache-commons-lang
1个回答
0
投票

处理获取依赖项的正常方法是将存储库添加到构建脚本中,到目前为止最流行的是 Maven Central。所以添加:

repositories {
    mavenCentral()
}

你应该可以走了。

© www.soinside.com 2019 - 2024. All rights reserved.