javaspring-bootmavenokhttpmockwebserver

Could not transfer artifact com.squareup.okhttp3:mockwebserver:pom:4.9.1 from/to central (https://repo.maven.apache.org/maven2)


I have encountered a problem while importing the MockWebServer dependencies into my project

<dependency>
  <groupId>com.squareup.okhttp3</groupId>
  <artifactId>okhttp</artifactId>
  <version>4.9.1</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>com.squareup.okhttp3</groupId>
  <artifactId>mockwebserver</artifactId>
  <version>4.9.1</version>
  <scope>test</scope>
</dependency>

Idea is showing 2 problems:

And reload all maven projects results in a big "stacktrace" which generally says that it can't resolve any of the dependencies.

Running maven goal compile results in an error:

Could not transfer artifact com.squareup.okhttp3:okhttp:pom:4.9.1 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp/4.9.1/okhttp-4.9.1.pom

Thanks.

My repo settings: repo settings screenshot


Solution

  • I fixed this issue. I believe it's my ISP problems. For some reason it doesn't give access to the repo links. Using VPN I was able to download the dependencies