无法解析配置“:runtimeClasspathCopy”的所有文件

Could not resolve all files for configuration ':runtimeClasspathCopy'

我使用 java sdk 17 为 minecraft 1.18.2 版创建 minecraft forge mod 项目时出现以下错误:

Could not resolve all files for configuration ':runtimeClasspathCopy'.
> Could not find net.minecraftforge:forge:1.18.2-40.1.25_mapped_official_1.18.2.
  Searched in the following locations:
    - file:/C:/Users/Hendrik/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.18.2-40.1.25_mapped_official_1.18.2/forge-1.18.2-40.1.25_mapped_official_1.18.2.pom
    - file:/C:/Users/Hendrik/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.18.2-40.1.25_mapped_official_1.18.2/forge-1.18.2-40.1.25_mapped_official_1.18.2.jar
  Required by:
      project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

给定的文档也没有真正帮助。

可能是你的缓存有问题,所以从

中删除了它

C:\Users\Hendrik\.gradle\caches\forge_gradle

并重新运行 genEclipseRuns