无法访问repo.spring.io进行Spring-boot练习

时间:2014-02-28 15:42:11

标签: spring-io

我目前正在查看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 个答案:

答案 0 :(得分:4)

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.

答案 1 :(得分: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>

答案 2 :(得分:1)

有关获得401的详细信息,请参阅this FAQ entry

简而言之,repo.spring.io懒洋洋地缓存了Maven Central的内容。您没有说出导致问题的依赖项,但我相信您遇到的问题是您正在尝试访问尚未缓存的工件。

尝试将mavenCentral()添加到build.gradle中已配置的存储库中。例如:

repositories {
    mavenCentral()
    maven { url "http://repo.spring.io/milestone" }
}

答案 3 :(得分:0)

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

  1. 转到.m2文件夹

  2. 创建settings.xml

  3. 复制下面的代码

    代码中的第一条评论