org.gradle.internal.resolve.ArtifactResolveException: Could not download assertj-core-3.13.2.jar
Hi, I have been trying to import a Spring project in Intellij Idea, and I have added a Spring reactive dependency.
This is my build.gradle file:
plugins {
id 'org.springframework.boot' version '2.2.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
}
group = 'ReactiveTest'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-webflux'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation 'io.projectreactor:reactor-test'
}
test {
useJUnitPlatform()
}
I get the following error:
Warning:<i><b>root project 'ReactiveTest': Unable to resolve additional project configuration.</b>
Details: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':testCompileClasspath'.
Caused by: org.gradle.internal.resolve.ArtifactResolveException: Could not download assertj-core-3.13.2.jar (org.assertj:assertj-core:3.13.2)
Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://repo.maven.apache.org/maven2/org/assertj/assertj-core/3.13.2/assertj-core-3.13.2.jar'.
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://repo.maven.apache.org/maven2/org/assertj/assertj-core/3.13.2/assertj-core-3.13.2.jar'.
Caused by: java.net.SocketTimeoutException: Read timed out</i>
If I remove this from build.gradle:
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
The import is successful.
I can visit https://repo.maven.apache.org/maven2/org/assertj/assertj-core/3.13.2/assertj-core-3.13.2.jar manually using a browser. But it takes some time for the download to start.
I guess the time required for the download to initialize is what is causing the socket timeout exception.
How can I add this downloaded jar file manually in the build so IDEA does not have to download it externally?
Any help/workaround will be much appreciated.
请先登录再写评论。
Hello,
Please try suggestions from this thread: https://discuss.gradle.org/t/put-jar-file-to-cache-manually/29488/3
Hello Yaroslav, thanks for the reply.
I tried to add the jar file to cache manually, but I am still getting the same error.
Have you switched to offline mode?
Hi, No. I am not working in offline mode. I am hiding behind a corporate proxy, but I have configured it already. And I can download other dependencies just fine.
Is it possible to share idea.log ("Help | Show Log in...") after restarting IDE and running "Reimport" from Gradle tool window?