![](/img/trans.png)
[英]How do a give an embedded Tomcat instance a custom classloader when using gradle-Tomcat-Plugin
[英]401 Unauthorized when trying to resolve org.gradle.api.plugins:gradle-tomcat-plugin:1.2.4
So, I am trying to build the sample spring security saml project provided in https://docs.spring.io/spring-security-saml/docs/1.0.x/reference/html/chapter-quick-start.html but i嘗試構建時出現以下錯誤:
* 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我得到同樣的錯誤。
任何想法,將不勝感激!
您好我有同樣的問題,根據這個答案,這是由於 spring repos 緩存工件,當工件尚未被緩存時,它返回 401。我解決了這個問題,只需將jcenter
添加到我在gralde.build
如下:
repositories {
jcenter()
maven { url "https://repo.spring.io/plugins-release" }
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.