从源代码构建Spring Security 时出错

fcy6dtqo  于 2021-07-06  发布在  Java
关注(0)|答案(1)|浏览(688)

我需要为我的实验从源代码构建Spring Security 。我执行了命令 $./gradlew install 遵循github中的指南:Spring Security 。但是,它返回以下错误:

  1. FAILURE: Build failed with an exception.
  2. * What went wrong:
  3. Could not determine the dependencies of task ':spring-security-config:compileKotlin'.
  4. > Could not resolve all files for configuration ':spring-security-config:kotlinCompilerClasspath'.
  5. > Could not resolve org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10.
  6. Required by:
  7. project :spring-security-config
  8. > Could not resolve org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10.
  9. > Could not get resource 'https://repo.spring.io/libs-snapshot/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.4.10/kotlin-compiler-embeddable-1.4.10.pom'.
  10. > Could not HEAD 'https://repo.spring.io/libs-snapshot/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.4.10/kotlin-compiler-embeddable-1.4.10.pom'. Received status code 401 from server: Unauthorized
  11. > Could not resolve org.jetbrains.kotlin:kotlin-bom:1.4.10.
  12. Required by:
  13. project :spring-security-config
  14. > Could not resolve org.jetbrains.kotlin:kotlin-bom:1.4.10.
  15. > Could not get resource 'https://repo.spring.io/libs-snapshot/org/jetbrains/kotlin/kotlin-bom/1.4.10/kotlin-bom-1.4.10.pom'.
  16. > Could not GET 'https://repo.spring.io/libs-snapshot/org/jetbrains/kotlin/kotlin-bom/1.4.10/kotlin-bom-1.4.10.pom'. Received status code 401 from server: Unauthorized
  17. * Try:
  18. 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.
  19. * Get more help at https://help.gradle.org
  20. Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
  21. Use '--warning-mode all' to show the individual deprecation warnings.
  22. See https://docs.gradle.org/6.6.1/userguide/command_line_interface.html#sec:command_line_warnings
  23. BUILD FAILED in 3m 53s

原因是什么?如何修复?

wd2eg0qa

wd2eg0qa1#

问题在于gradle错误:
从服务器收到状态代码401:未授权
项目正在尝试使用https://repo.spring.io/libs-snapshot 被拒绝了 401 http状态。
它可能会失败,因为spring基础设施团队最近实施了一些限制。有关更多详细信息,请参阅博客文章:https://spring.io/blog/2020/10/29/notice-of-permissions-changes-to-repo-spring-io-fall-and-winter-2020
一个可能的解决方案是修改项目的存储库,以便使用maven central或jcenter等公共存储库。有关更多详细信息,请参阅gradle的文档。
如果Spring Security 构建需要只在现在私有的spring存储库中可用的工件,则无法保证这是否有效。

相关问题