I created a new Gradle project today in IntelliJ and couldn't build it, every time it failed with this error:
> Could not resolve org.springframework:spring-core:5.3.17.
Required by:
project : > org.springframework.boot:org.springframework.boot.gradle.plugin:2.6.5 > org.springframework.boot:spring-boot-gradle-plugin:2.6.5
> Could not resolve org.springframework:spring-core:5.3.17.
> Could not get resource 'https://plugins.gradle.org/m2/org/springframework/spring-core/5.3.17/spring-core-5.3.17.pom'.
> Could not GET 'https://repo.gradle.org/artifactory/jcenter/org/springframework/spring-core/5.3.17/spring-core-5.3.17.pom'.
> Read timed out
Since the reported URL contains 'jcenter' in it, I'm wondering if the failure it related to JCenter shutdown. I couldn't explain how it happened since I use mavenCentral repository.
This is my very simple build.gradle file:
plugins {
id 'org.springframework.boot' version '2.6.5'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'org.sample'
version = '1.0.0'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
tasks.named('test') {
useJUnitPlatform()
}
When I tried to open https://plugins.gradle.org/m2/org/springframework/spring-core/5.3.17/spring-core-5.3.17.pom in browser, HTTP 303 was returned + location = https://repo.gradle.org/artifactory/jcenter/org/springframework/spring-core/5.3.17/spring-core-5.3.17.pom .
Does anyone face the same issue?