Skip to content

Commit a220802

Browse files
authored
Update MinIO to 8.6.0 (#1605)
Update MinIO and okhttp3 to latest.
1 parent 2de5c82 commit a220802

File tree

2 files changed

+34
-16
lines changed

2 files changed

+34
-16
lines changed

maven-resolver-transport-minio/pom.xml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,22 @@
3434

3535
<properties>
3636
<javaVersion>8</javaVersion>
37+
38+
<okhttpVersion>5.1.0</okhttpVersion>
3739
</properties>
3840

41+
<dependencyManagement>
42+
<dependencies>
43+
<dependency>
44+
<groupId>com.squareup.okhttp3</groupId>
45+
<artifactId>okhttp-bom</artifactId>
46+
<version>${okhttpVersion}</version>
47+
<type>pom</type>
48+
<scope>import</scope>
49+
</dependency>
50+
</dependencies>
51+
</dependencyManagement>
52+
3953
<dependencies>
4054
<dependency>
4155
<groupId>org.slf4j</groupId>
@@ -63,10 +77,15 @@
6377
<dependency>
6478
<groupId>io.minio</groupId>
6579
<artifactId>minio</artifactId>
66-
<version>8.5.17</version>
80+
<version>8.6.0</version>
6781
</dependency>
6882

6983
<!-- Overrides/Updates for Minio Java -->
84+
<dependency>
85+
<groupId>com.squareup.okhttp3</groupId>
86+
<artifactId>okhttp-jvm</artifactId>
87+
<version>${okhttpVersion}</version>
88+
</dependency>
7089
<dependency>
7190
<groupId>commons-codec</groupId>
7291
<artifactId>commons-codec</artifactId>

maven-resolver-transport-minio/src/test/java/org/eclipse/aether/transport/minio/MinioTransporterIT.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class MinioTransporterIT {
5959
private static final String OBJECT_CONTENT = "content";
6060

6161
private MinIOContainer minioContainer;
62-
private MinioClient minioClient;
6362
private RepositorySystemSession session;
6463
private ObjectNameMapperFactory objectNameMapperFactory;
6564

@@ -69,19 +68,19 @@ void startSuite() throws Exception {
6968

7069
minioContainer = new MinIOContainer("minio/minio:latest");
7170
minioContainer.start();
72-
minioClient = MinioClient.builder()
71+
try (MinioClient minioClient = MinioClient.builder()
7372
.endpoint(minioContainer.getS3URL())
7473
.credentials(minioContainer.getUserName(), minioContainer.getPassword())
75-
.build();
76-
77-
minioClient.makeBucket(MakeBucketArgs.builder().bucket(BUCKET_NAME).build());
78-
try (FileUtils.TempFile tempFile = FileUtils.newTempFile()) {
79-
Files.write(tempFile.getPath(), OBJECT_CONTENT.getBytes(StandardCharsets.UTF_8));
80-
minioClient.uploadObject(UploadObjectArgs.builder()
81-
.bucket(BUCKET_NAME)
82-
.object(OBJECT_NAME)
83-
.filename(tempFile.getPath().toString())
84-
.build());
74+
.build()) {
75+
minioClient.makeBucket(MakeBucketArgs.builder().bucket(BUCKET_NAME).build());
76+
try (FileUtils.TempFile tempFile = FileUtils.newTempFile()) {
77+
Files.write(tempFile.getPath(), OBJECT_CONTENT.getBytes(StandardCharsets.UTF_8));
78+
minioClient.uploadObject(UploadObjectArgs.builder()
79+
.bucket(BUCKET_NAME)
80+
.object(OBJECT_NAME)
81+
.filename(tempFile.getPath().toString())
82+
.build());
83+
}
8584
}
8685

8786
session = new DefaultRepositorySystemSession(h -> true);
@@ -135,7 +134,7 @@ void peekWithWrongAuth() throws NoTransporterException {
135134
fail("Should throw");
136135
} catch (Exception e) {
137136
assertInstanceOf(ErrorResponseException.class, e);
138-
assertEquals(transporter.classify(e), Transporter.ERROR_OTHER);
137+
assertEquals(Transporter.ERROR_OTHER, transporter.classify(e));
139138
}
140139
}
141140
}
@@ -149,7 +148,7 @@ void peekNonexistent() throws NoTransporterException {
149148
fail("Should throw");
150149
} catch (Exception e) {
151150
assertInstanceOf(ErrorResponseException.class, e);
152-
assertEquals(transporter.classify(e), Transporter.ERROR_NOT_FOUND);
151+
assertEquals(Transporter.ERROR_NOT_FOUND, transporter.classify(e));
153152
}
154153
}
155154
}
@@ -172,7 +171,7 @@ void getNonexistent() throws NoTransporterException {
172171
fail("Should throw");
173172
} catch (Exception e) {
174173
assertInstanceOf(ErrorResponseException.class, e);
175-
assertEquals(transporter.classify(e), Transporter.ERROR_NOT_FOUND);
174+
assertEquals(Transporter.ERROR_NOT_FOUND, transporter.classify(e));
176175
}
177176
}
178177
}

0 commit comments

Comments
 (0)