8

我目前正在查看 spring-boot,但无法访问构建中的 repo.spring.io maven 存储库。

我已经创建了初始 Gradle 构建文件,但是当我第一次尝试运行构建时收到 401(未经授权)响应。我尝试手动拉下 POM/JAR(手动部署到我的本地存储库),但再次收到 401。

如果我浏览到相关文件夹并单击 JAR(POMS 似乎没问题),我也会在这里收到 401 错误(响应是The server http://repo.spring.io:80 requires a username and password. The server says: Artifactory Realm:)

有人可以指导我到一个我实际上可以从中提取这些文件的仓库吗?或者,有人可以指导我到哪里可以获得此回购的凭据吗?

谢谢

4

4 回答 4

6

repo.spring.io lazily caches the contents of Maven Central. You don't say which dependency it is that's causing a problem, but I believe the problem that you're seeing is that you're attempting to access an artifact that has yet to be cached. This will result in a 401 response.

Trying adding mavenCentral() to the configured repositories in build.gradle. For example:

repositories {
    mavenCentral()
    maven { url "https://repo.spring.io/milestone" }
}
于 2014-03-04T11:07:05.613 回答
5

repo.spring.io 不再通过普通 http 提供服务。检查您的 gradle(pom.xml 等)文件中的http://repo.spring.io并将其更改为https://repo.spring.io

相关的 maven 错误信息与此类似:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.8.2:site (default-site) on project tidy-up: SiteToolException: The site descriptor cannot be resolved from the repository: ArtifactResolutionException: Unable to locate site descriptor: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:xml:site_en:2.2.4.RELEASE from/to springplugins (http://repo.spring.io/plugins-release/): Access denied to: http://repo.spring.io/plugins-release/org/springframework/boot/spring-boot-starter-parent/2.2.4.RELEASE/spring-boot-starter-parent-2.2.4.RELEASE-site_en.xml , ReasonPhrase:Forbidden.
于 2020-02-24T17:23:38.687 回答
2

repo.spring.io 不再通过普通 http 提供服务。

1- 检查您的 pom.xml 文件中的http://repo.spring.io/plugins-release/

2-并将其更改为https://repo.spring.io/plugins-release/

像下面

<repositories>
  <repository>
    <id>spring-repo</id>
    <url>https://repo.spring.io/plugins-release/</url>
  </repository>
</repositories>
于 2020-06-14T16:08:28.293 回答
0

当我尝试在弹簧靴上练习时,这对我有用。

  1. 转到 .m2 文件夹

  2. 创建 settings.xml

  3. 复制下面的代码

    第一条评论中的代码

于 2020-08-27T03:52:52.650 回答