从源代码构建Spring Security 时出错

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

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

FAILURE: Build failed with an exception.

* What went wrong:

Could not determine the dependencies of task ':spring-security-config:compileKotlin'.
> Could not resolve all files for configuration ':spring-security-config:kotlinCompilerClasspath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10.
     Required by:
         project :spring-security-config
      > Could not resolve org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10.
         > 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'.
            > 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
   > Could not resolve org.jetbrains.kotlin:kotlin-bom:1.4.10.
     Required by:
         project :spring-security-config
      > Could not resolve org.jetbrains.kotlin:kotlin-bom:1.4.10.
         > Could not get resource 'https://repo.spring.io/libs-snapshot/org/jetbrains/kotlin/kotlin-bom/1.4.10/kotlin-bom-1.4.10.pom'.
            > 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

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.6.1/userguide/command_line_interface.html#sec:command_line_warnings

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存储库中可用的工件,则无法保证这是否有效。

相关问题