square/okhttp

Unresolved imports after upgrade to 5.1.0 version

Closed this issue · 1 comments

After upgrading the logging-interceptor dependency to the 5.1.0 version, I face issues with imports and cannot compile my projects. When I downgrade logging-interceptor to 4.12.0 - all work fine

And I get these errors:

Cannot resolve symbol 'Interceptor'
Cannot resolve symbol 'Request'
Cannot resolve symbol 'Response'

On this class:

import lombok.extern.slf4j.Slf4j;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
import org.springframework.stereotype.Component;


@Component
@Slf4j
public class OkHttpLoggingHeadersInterceptor implements Interceptor {}

So, in my pom I have this dependencies:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp-bom</artifactId>
      <version>5.1.0</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>
<dependency>
  <groupId>com.squareup.okhttp3</groupId>
  <artifactId>okhttp-jvm</artifactId>
  <version>5.1.0</version>
</dependency>

<dependency>
  <groupId>com.squareup.okhttp3</groupId>
  <artifactId>mockwebserver3</artifactId>
</dependency>

<dependency>
  <groupId>com.squareup.okhttp3</groupId>
  <artifactId>logging-interceptor</artifactId>
  <version>5.1.0</version>
</dependency>

I tried importing the latest 5.1.0 okhttp3 package, but there is no classes in there

Image

That looks correct and matches https://github.com/square/okhttp?tab=readme-ov-file#maven-and-jvm-projects and other similar reported issues.

While okhttp is empty, you also have okhttp-jvm so the classes are available.

Please create a sample project reproducing this problem. As is, we can't help.

We generally can't help with your build issues, although I appreciate that Maven and Kotlin MP don't seem to work well together.