401在尝试解析org.gradle.api时未经授权plugins:gradle-tomcat-plugin:1.2.4

kpbpu008  于 2021-07-03  发布在  Java
关注(0)|答案(1)|浏览(676)

因此,我尝试构建中提供的示例spring security saml项目https://docs.spring.io/spring-security-saml/docs/1.0.x/reference/html/chapter-quick-start.html 但我在尝试构建时遇到以下错误:


* What went wrong:

A problem occurred configuring root project 'spring-security-saml'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.gradle.api.plugins:gradle-tomcat-plugin:1.2.4.
     Required by:
         project :
      > Could not resolve org.gradle.api.plugins:gradle-tomcat-plugin:1.2.4.
         > Could not get resource 'https://repo.spring.io/plugins-release/org/gradle/api/plugins/gradle-tomcat-plugin/1.2.4/gradle-tomcat-plugin-1.2.4.pom'.
            > Could not GET 'https://repo.spring.io/plugins-release/org/gradle/api/plugins/gradle-tomcat-plugin/1.2.4/gradle-tomcat-plugin-1.2.4.pom'. Received status code 401 from server: Unauthorized

我找不到一个明确的解释,但即使我试图导航到https://repo.spring.io/plugins-release/org/gradle/api/plugins/gradle-tomcat-plugin/1.2.4/gradle-tomcat-plugin-1.2.4.pom 在浏览器上我得到同样的错误。
任何想法都将不胜感激!

jbose2ul

jbose2ul1#

你好,我有同样的问题,根据这个答案,这是由于spring repos缓存工件的事实,当工件还没有被缓存时,它返回401。我只需添加 jcenter 中的“我的配置存储库” gralde.build 如下所示:

repositories {
         jcenter()
         maven { url "https://repo.spring.io/plugins-release" }
}

相关问题