IntelliJ无法下载commons-lang3-3.12.0-sources及快速文档缺失问题
Commons-Lang3源码下载失败,无法查看快速文档
我无法查看commons-lang的快速文档,进入反编译的.class文件后点击「Download Sources」时下载失败,报错信息如下:
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的快速文档可正常查看,不清楚问题原因。
解决办法:
- 检查本地Maven仓库路径
/Users/rob.bram/.m2/repository/org/apache/commons/commons-lang3/3.12.0/,确认是否存在commons-lang3-3.12.0-sources.jar。若不存在,手动下载对应版本的源码jar包放到该目录。 - 执行Gradle命令强制刷新依赖:
./gradlew clean build --refresh-dependencies - 确认build.gradle中已配置Maven中央仓库,若未添加,补充以下配置:
repositories { mavenCentral() } - 在IDEA中执行「File → Invalidate Caches... → Invalidate and Restart」,重启IDE后再次尝试下载源码。
内容的提问来源于stack exchange,提问作者Robert Mark Bram
相关产品推荐
相关产品推荐

