Skip to content

Commit ca6b18f

Browse files
committed
Move to JDK 25 for build only
Signed-off-by: Bala.FA <bala@minio.io>
1 parent 942e2e5 commit ca6b18f

14 files changed

Lines changed: 108 additions & 68 deletions

File tree

.gitattributes

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
* text eol=lf
1+
# Normalize text files to LF, but let Git auto-detect binaries so they are
2+
# stored byte-for-byte (a blanket "* text" corrupts binaries like the Gradle
3+
# wrapper jar by stripping CR bytes during line-ending normalization).
4+
* text=auto eol=lf
5+
6+
# Always treat these as binary regardless of auto-detection.
7+
*.jar binary
8+
*.zip binary
9+
*.gz binary
10+
*.class binary
11+
*.png binary
12+
*.jpg binary
13+
*.gif binary
14+
*.ico binary

.github/workflows/gradle.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ jobs:
2929
exit 1
3030
fi
3131
32-
- name: Setup java 17 for building
32+
- name: Setup java 25 for building
3333
uses: actions/setup-java@v5
3434
with:
3535
distribution: temurin
36-
java-version: '17'
36+
java-version: '25'
3737

3838
- name: Set environment variables on Ubuntu
3939
if: matrix.os == 'ubuntu-latest'
@@ -59,7 +59,7 @@ jobs:
5959
./gradlew.bat build
6060
6161
- name: Setup java ${{ matrix.java-version }} for testing
62-
if: matrix.java-version != '17'
62+
if: matrix.java-version != '25'
6363
uses: actions/setup-java@v5
6464
with:
6565
distribution: temurin

adminapi/src/main/java/io/minio/admin/MinioAdminClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,10 @@ public long getBucketQuota(String bucketName) throws MinioException {
453453
OBJECT_MAPPER
454454
.getTypeFactory()
455455
.constructMapType(HashMap.class, String.class, JsonNode.class);
456-
return OBJECT_MAPPER.<Map<String, JsonNode>>readValue(response.body().bytes(), mapType)
457-
.entrySet().stream()
456+
return OBJECT_MAPPER
457+
.<Map<String, JsonNode>>readValue(response.body().bytes(), mapType)
458+
.entrySet()
459+
.stream()
458460
.filter(entry -> "quota".equals(entry.getKey()))
459461
.findFirst()
460462
.map(entry -> Long.valueOf(entry.getValue().toString()))

api/src/main/java/io/minio/Checksum.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
public class Checksum {
3434
/** MD5 hash of zero length byte array. */
3535
public static final String ZERO_MD5_HASH = "1B2M2Y8AsgTpgAmY7PhCfg==";
36+
3637
/** SHA-256 hash of zero length byte array. */
3738
public static final String ZERO_SHA256_HASH =
3839
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";

api/src/main/java/io/minio/Http.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ public static OkHttpClient setTimeout(
890890
.build();
891891
}
892892

893-
/** HTTP body of {@link RandomAccessFile}, {@link ByteBuffer} or {@link byte} array. */
893+
/** HTTP body of {@link RandomAccessFile}, {@link ByteBuffer} or {@code byte} array. */
894894
public static class Body {
895895
private okhttp3.RequestBody requestBody;
896896
private RandomAccessFile file;

api/src/main/java/io/minio/PartReader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ private void readOneByte() throws MinioException {
9696
int n = 0;
9797

9898
try {
99-
while ((n = file != null ? file.read(oneByte) : stream.read(oneByte)) == 0) ;
99+
while ((n = file != null ? file.read(oneByte) : stream.read(oneByte)) == 0)
100+
;
100101
} catch (IOException e) {
101102
throw new MinioException(e);
102103
}

api/src/main/java/io/minio/errors/MinioException.java

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,26 @@ public String httpTrace() {
6262

6363
/** Throws encapsulated exception. */
6464
public void throwEncapsulatedException()
65-
throws BucketPolicyTooLargeException, CertificateException, EOFException,
66-
ErrorResponseException, FileNotFoundException, GeneralSecurityException,
67-
InsufficientDataException, InternalException, InvalidKeyException,
68-
InvalidResponseException, IOException, JsonMappingException, JsonParseException,
69-
JsonProcessingException, KeyManagementException, KeyStoreException, MinioException,
70-
NoSuchAlgorithmException, ServerException, XmlParserException {
65+
throws BucketPolicyTooLargeException,
66+
CertificateException,
67+
EOFException,
68+
ErrorResponseException,
69+
FileNotFoundException,
70+
GeneralSecurityException,
71+
InsufficientDataException,
72+
InternalException,
73+
InvalidKeyException,
74+
InvalidResponseException,
75+
IOException,
76+
JsonMappingException,
77+
JsonParseException,
78+
JsonProcessingException,
79+
KeyManagementException,
80+
KeyStoreException,
81+
MinioException,
82+
NoSuchAlgorithmException,
83+
ServerException,
84+
XmlParserException {
7185
Throwable e = getCause();
7286

7387
// Inherited by MinioException

build.gradle

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
*/
1616

1717
/********************************/
18-
/* gradleVersion = '9.4.1' */
18+
/* gradleVersion = '9.6.0' */
1919
/********************************/
2020

2121
plugins {
22-
id 'com.gradleup.shadow' version '9.0.0'
23-
id 'com.github.spotbugs' version '6.5.1'
24-
id 'org.jreleaser' version '1.23.0'
25-
id 'com.diffplug.spotless' version '6.13.0'
22+
id 'com.gradleup.shadow' version '9.4.2'
23+
id 'com.github.spotbugs' version '6.5.8'
24+
id 'org.jreleaser' version '1.24.0'
25+
id 'com.diffplug.spotless' version '8.7.0'
2626
}
2727

2828
/* Root project definitions */
@@ -48,22 +48,26 @@ subprojects {
4848
dependencies {
4949
api 'com.carrotsearch.thirdparty:simple-xml-safe:2.7.1'
5050
api 'com.google.guava:guava:33.6.0-jre'
51-
api 'com.squareup.okhttp3:okhttp:5.3.2'
52-
api 'com.fasterxml.jackson.core:jackson-annotations:2.21'
53-
api 'com.fasterxml.jackson.core:jackson-core:2.21.2'
54-
api 'com.fasterxml.jackson.core:jackson-databind:2.21.2'
51+
api 'com.squareup.okhttp3:okhttp:5.4.0'
52+
api 'com.fasterxml.jackson.core:jackson-annotations:2.22'
53+
api 'com.fasterxml.jackson.core:jackson-core:2.22.0'
54+
api 'com.fasterxml.jackson.core:jackson-databind:2.22.0'
5555
api 'org.bouncycastle:bcprov-jdk18on:1.84'
5656
api 'org.apache.commons:commons-compress:1.28.0'
57-
api 'commons-codec:commons-codec:1.21.0'
57+
api 'commons-codec:commons-codec:1.22.0'
5858
api 'org.xerial.snappy:snappy-java:1.1.10.8'
59-
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.9.8'
59+
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.10.2'
6060

61-
testImplementation 'com.squareup.okhttp3:mockwebserver:5.3.2'
62-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.14.3'
61+
testImplementation 'com.squareup.okhttp3:mockwebserver:5.4.0'
62+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.14.4'
6363
}
6464

6565
[compileJava, compileTestJava].each() {
6666
it.options.fork = true
67+
// Build runs on JDK 25 (see java.toolchain) but enforces the Java 8 API surface and
68+
// emits Java 8 bytecode via --release 8. --release also avoids the "source/target 8 is
69+
// obsolete" warning; -Xlint:-options is kept as a belt-and-braces guard for -Werror.
70+
it.options.release = 8
6771
it.options.compilerArgs += ['-Xlint:unchecked', '-Xlint:deprecation', '-Xlint:-options', '-Werror', '-Xdiags:verbose']
6872
it.options.encoding = 'UTF-8'
6973
}
@@ -103,6 +107,10 @@ subprojects {
103107
check.dependsOn localeTest
104108

105109
java {
110+
// Compile/test/javadoc run on JDK 25; bytecode/API level pinned to Java 8 via release below.
111+
toolchain {
112+
languageVersion = JavaLanguageVersion.of(25)
113+
}
106114
sourceCompatibility = JavaVersion.VERSION_1_8
107115
targetCompatibility = JavaVersion.VERSION_1_8
108116
}
@@ -112,7 +120,7 @@ subprojects {
112120
target '**/*.java'
113121
importOrder 'edu', 'com', 'io', 'java', 'javax', 'org', ''
114122
removeUnusedImports()
115-
googleJavaFormat('1.7')
123+
googleJavaFormat('1.35.0')
116124
}
117125
groovyGradle {
118126
target '*.gradle'
@@ -226,7 +234,7 @@ project(':api') {
226234
}
227235

228236
signing {
229-
required {
237+
required = {
230238
gradle.taskGraph.allTasks.any { it.name.contains('LocalMavenWithChecksums') }
231239
}
232240
sign publishing.publications.minioJava
@@ -346,7 +354,7 @@ project(':adminapi') {
346354
}
347355

348356
signing {
349-
required {
357+
required = {
350358
gradle.taskGraph.allTasks.any { it.name.contains('LocalMavenWithChecksums') }
351359
}
352360
sign publishing.publications.minioJava
@@ -355,7 +363,7 @@ project(':adminapi') {
355363

356364
project(':examples') {
357365
dependencies {
358-
compileOnly 'me.tongfei:progressbar:0.9.5'
366+
compileOnly 'me.tongfei:progressbar:0.10.2'
359367
compileOnly project(':api')
360368
}
361369

@@ -367,14 +375,17 @@ project(':examples') {
367375
main {
368376
java {
369377
srcDirs = ["$rootDir/examples"]
378+
// srcDir is the module root, which also contains build/; keep generated
379+
// files (e.g. Spotless lint output) out of compilation.
380+
exclude 'build/**'
370381
}
371382
}
372383
}
373384
}
374385

375386
project(':functional') {
376387
dependencies {
377-
implementation 'org.junit.jupiter:junit-jupiter-api:5.14.3'
388+
implementation 'org.junit.jupiter:junit-jupiter-api:5.14.4'
378389
implementation project(':api')
379390
implementation project(':adminapi')
380391
}
@@ -387,6 +398,9 @@ project(':functional') {
387398
main {
388399
java {
389400
srcDirs = ["$rootDir/functional"]
401+
// srcDir is the module root, which also contains build/; keep generated
402+
// files (e.g. Spotless lint output) out of compilation.
403+
exclude 'build/**'
390404
}
391405
}
392406
}

functional/TestMinioClient.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,9 @@ public void putObject() throws Exception {
548548

549549
testPutObject(
550550
"[object name ends with '/']",
551-
PutObjectArgs.builder().bucket(bucketName).object("path/to/" + getRandomName() + "/")
551+
PutObjectArgs.builder()
552+
.bucket(bucketName)
553+
.object("path/to/" + getRandomName() + "/")
552554
.stream(new ContentInputStream(0), 0L, null)
553555
.contentType(CUSTOM_CONTENT_TYPE)
554556
.build(),
@@ -1445,7 +1447,9 @@ public void testCopyObject(
14451447
client.makeBucket(MakeBucketArgs.builder().bucket(args.source().bucket()).build());
14461448
try {
14471449
PutObjectArgs.Builder builder =
1448-
PutObjectArgs.builder().bucket(args.source().bucket()).object(args.source().object())
1450+
PutObjectArgs.builder()
1451+
.bucket(args.source().bucket())
1452+
.object(args.source().object())
14491453
.stream(new ContentInputStream(1 * KB), 1L * KB, null);
14501454
if (sse != null) builder.sse(sse);
14511455
client.putObject(builder.build());

gradle/wrapper/gradle-wrapper.jar

4.76 KB
Binary file not shown.

0 commit comments

Comments
 (0)