From 0.17.1 onwards the okhttp version was changed to 5.x again and the same issue NoClassDefFoundError came up again, so I had to manually exclude okhttp and import the 4.x version of okhttp.
Or change version to 0.17.0
<dependency>
<groupId>com.meilisearch.sdk</groupId>
<artifactId>meilisearch-java</artifactId>
<version>0.18.0</version>
<exclusions>
<exclusion>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.12.0</version>
</dependency>