0

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:

  • Dependency 'com.squareup.okhttp3:okhttp:4.9.1' not found
  • Dependency 'com.squareup.okhttp3:mockwebserver:4.9.1' not found

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

Neuron
  • 5,141
  • 5
  • 38
  • 59
red
  • 3
  • 3
  • Looks like a network issue... apart from that the url is wrong (correct: https://repo1.maven.org/maven2/)... – khmarbaise Sep 03 '21 at 12:22
  • @khmarbaise actually maybe you're right about the network issue. Today I'm unable to access some websites without a VPN, it just doesn't connect. Invalidating cache didn't do a thing by the way and I still could redownload every other dependency – red Sep 03 '21 at 12:27

1 Answers1

0

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

red
  • 3
  • 3