gpt4 book ai didi

java - 无法解决 spring-mvc 项目中的 spring-webmvc-5.0.0.M5 依赖关系

转载 作者:行者123 更新时间:2023-12-01 18:00:55 24 4
gpt4 key购买 nike

我有一个spring-mvc项目。在我的 pom 文件中,之前添加了以下依赖项:

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.0.0.M5</version>
</dependency>

存储库是:

<repositories>
<repository>
<id>Alfresco Public Repository</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
</repository>
</repositories>

我删除了.m2下的存储库文件夹。之后,当我尝试构建项目时出现以下错误(mvn clean install):

The following artifacts could not be resolved: org.springframework:spring-webmvc:jar:5.0.0.M5: Failure to find org.springframework:spring-webmvc:jar:5.0.0.M5 in https://artifacts.alfresco.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of Alfresco Public Repository has elapsed or updates are forced

我在我的pom中添加了新的存储库:

<repositories>
<repository>
<id>Alfresco Public Repository</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
</repository>
<repository>
<id>repository.spring.milestone</id>
<name>Spring Milestone Repository</name>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories>

现在我收到以下错误:

Failed to collect dependencies at org.springframework:spring-webmvc:jar:5.0.0.M5: Failed to read artifact descriptor for org.springframework:spring-webmvc:jar:5.0.0.M5: Could not transfer artifact org.springframework:spring-webmvc:pom:5.0.0.M5 from/to repository.spring.milestone (http://repo.spring.io/milestone): Access denied to: http://repo.spring.io/milestone/org/springframework/spring-webmvc/5.0.0.M5/spring-webmvc-5.0.0.M5.pom

从浏览器中我可以看到spring-webmvc-5.0.0.M5.pom

  1. 为什么我收到“访问被拒绝”信息?
  2. 这个问题的解决方案是什么?

Note: I am unable to update the version 5.0.0.M5 to 5.0.0.RELEASE

最佳答案

根据 @Sebastian's comment ,我已在 Spring Milestone Repository 中将 http 更改为 https:

<repository>
<id>repository.spring.milestone</id>
<name>Spring Milestone Repository</name>
<url>https://repo.spring.io/milestone</url>
</repository>

现在一切正常。谢谢@Sebastian

关于java - 无法解决 spring-mvc 项目中的 spring-webmvc-5.0.0.M5 依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60631510/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com