Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failure when minio-java is used as dependency as some API are no more available at build time #1411

Closed
mmadoo opened this issue Jan 9, 2023 · 2 comments · Fixed by #1412

Comments

@mmadoo
Copy link
Contributor

mmadoo commented Jan 9, 2023

Due to folllowing change 8c7a5be#diff-49a96e7eea8a94af862798a45174e6ac43eb4f8b4bd40759b5da63ba31ec3ef7R54 in 8.5.0, dependencies like guava, okhttp and jackson are provided in runtime while there was in compile scope before.
Thus, some API like MinioAsyncClient.builder().httpClient(httpClient) no more compile.

/builds/.../s3/S3Storage.java:[33,15] package okhttp3 does not exist
[ERROR] /builds/.../s3/S3Storage.java:[47,23] cannot find symbol
  symbol:   class OkHttpClient
  location: class ....s3.S3Storage

I have found the following woraround in my maven project by adding the dependencyManagement part:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<artifactId>s3-storage</artifactId>
	<name>MyProject:: S3 Storage</name>

	<dependencies>
		<dependency>
			<groupId>io.minio</groupId>
			<artifactId>minio</artifactId>
                        <version>8.5.0</version>
		</dependency>
	</dependencies>
	
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.squareup.okhttp3</groupId>
				<artifactId>okhttp</artifactId>
				<scope>compile</scope>
			</dependency>
			<dependency>
				<groupId>com.fasterxml.jackson.core</groupId>
				<artifactId>jackson-databind</artifactId>
				<scope>compile</scope>
			</dependency>
			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<scope>compile</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>
</project>
@balamurugana
Copy link
Member

implementation means to put the dependency to compile and runtime path. There is no error here.

@mmadoo
Copy link
Contributor Author

mmadoo commented Jan 9, 2023

If you look at pom published on maven public: https://repo1.maven.org/maven2/io/minio/minio/8.5.0/minio-8.5.0.pom
dependencies have the runtime scope.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants