Issue
I have a spring-mvc project. In my pom file following dependency was added previously:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.0.0.M5</version>
</dependency>
And repository is:
<repositories>
<repository>
<id>Alfresco Public Repository</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
</repository>
</repositories>
I deleted repository folder under .m2. After that I was getting following error when I try to build the project(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
I have added new repository in my 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>
Now I am getting following error:
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
From browser I can see spring-webmvc-5.0.0.M5.pom.
- Why I am getting "Access denied"?
- What is the solution of this problem?
Note: I am unable to update the version 5.0.0.M5 to 5.0.0.RELEASE
Solution
As per @Sebastian's comment, I have changed http to https at Spring Milestone Repository:
<repository>
<id>repository.spring.milestone</id>
<name>Spring Milestone Repository</name>
<url>https://repo.spring.io/milestone</url>
</repository>
It's working fine now. Thanks @Sebastian
Answered By - Asraf Uddin Ahmed
Answer Checked By - Katrina (JavaFixing Volunteer)