Okhttp3 com.square 不存在

Die*_*ves 2 java maven okhttp netbeans-8

我正在使用 Netbeans,并使用 Maven 创建了 java 项目。我添加了这个依赖项。

 <dependency>
    <groupId>com.squareup.okhttp</groupId>
    <artifactId>okhttp</artifactId>
    <version>2.7.2</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

它有效,我可以导入 com.squareup.okhttp.*。在网上看到一些代码后,我意识到很多人都在使用 3+ 版本。我尝试将包更改为:

更新 我在问题“com.squareup.okhttp”中错误地输入了groupid,但在我的代码中它是正确的“com.squareup.okhttp3”。

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.9.0</version>
Run Code Online (Sandbox Code Playgroud)

但我无法导入 com.squareup.okhttp3 (包 com.squareup 不存在)。为什么?我对 Java 语言本身以及支持它的所有 IDE 和工具都很陌生。

Die*_*ves 5

导入只是 okhttp3: "import okhttp3" 没有 com.square。