19
19
/* *******************************/
20
20
21
21
plugins {
22
- id " com.github.johnrengelman.shadow" version " 8.1.1"
23
- id " com.github.spotbugs" version " 6.1.3"
24
- id " io.github.gradle-nexus.publish-plugin " version " 2.0.0 "
25
- id " com.diffplug.spotless" version " 6.13.0"
22
+ id ' com.github.johnrengelman.shadow' version ' 8.1.1'
23
+ id ' com.github.spotbugs' version ' 6.1.3'
24
+ id ' org.jreleaser ' version ' 1.17.0 '
25
+ id ' com.diffplug.spotless' version ' 6.13.0'
26
26
}
27
27
28
- /*
29
- * Root project definitions
30
- */
31
- apply plugin : ' io.github.gradle-nexus.publish-plugin'
28
+ /* Root project definitions */
32
29
33
30
allprojects {
34
31
group = ' io.minio'
@@ -41,34 +38,34 @@ allprojects {
41
38
subprojects {
42
39
apply plugin : ' java-library'
43
40
apply plugin : ' com.github.spotbugs'
44
- apply plugin : " com.diffplug.spotless"
41
+ apply plugin : ' com.diffplug.spotless'
45
42
46
43
repositories {
47
44
mavenLocal()
48
45
mavenCentral()
49
46
}
50
47
51
48
dependencies {
52
- api " com.carrotsearch.thirdparty:simple-xml-safe:2.7.1"
53
- api " com.google.guava:guava:33.4.0-jre"
54
- api " com.squareup.okhttp3:okhttp:4.12.0"
55
- api " com.fasterxml.jackson.core:jackson-annotations:2.18.2"
56
- api " com.fasterxml.jackson.core:jackson-core:2.18.2"
57
- api " com.fasterxml.jackson.core:jackson-databind:2.18.2"
58
- api " org.bouncycastle:bcprov-jdk18on:1.80"
59
- api " org.apache.commons:commons-compress:1.27.1"
60
- api " commons-codec:commons-codec:1.18.0"
61
- api " org.xerial.snappy:snappy-java:1.1.10.7"
62
- compileOnly " com.github.spotbugs:spotbugs-annotations:4.8.6"
63
-
64
- testImplementation " com.squareup.okhttp3:mockwebserver:4.12.0"
65
- testImplementation " junit:junit:4.13.2"
49
+ api ' com.carrotsearch.thirdparty:simple-xml-safe:2.7.1'
50
+ api ' com.google.guava:guava:33.4.0-jre'
51
+ api ' com.squareup.okhttp3:okhttp:4.12.0'
52
+ api ' com.fasterxml.jackson.core:jackson-annotations:2.18.2'
53
+ api ' com.fasterxml.jackson.core:jackson-core:2.18.2'
54
+ api ' com.fasterxml.jackson.core:jackson-databind:2.18.2'
55
+ api ' org.bouncycastle:bcprov-jdk18on:1.80'
56
+ api ' org.apache.commons:commons-compress:1.27.1'
57
+ api ' commons-codec:commons-codec:1.18.0'
58
+ api ' org.xerial.snappy:snappy-java:1.1.10.7'
59
+ compileOnly ' com.github.spotbugs:spotbugs-annotations:4.8.6'
60
+
61
+ testImplementation ' com.squareup.okhttp3:mockwebserver:4.12.0'
62
+ testImplementation ' junit:junit:4.13.2'
66
63
}
67
64
68
65
[compileJava, compileTestJava]. each() {
69
66
it. options. fork = true
70
- it. options. compilerArgs + = [" -Xlint:unchecked" , " -Xlint:deprecation" , " -Xlint:-options" , " -Werror" , " -Xdiags:verbose" ]
71
- it. options. encoding = " UTF-8"
67
+ it. options. compilerArgs + = [' -Xlint:unchecked' , ' -Xlint:deprecation' , ' -Xlint:-options' , ' -Werror' , ' -Xdiags:verbose' ]
68
+ it. options. encoding = ' UTF-8'
72
69
}
73
70
74
71
spotbugs {
@@ -98,7 +95,7 @@ subprojects {
98
95
}
99
96
100
97
task localeTest(type : Test ) {
101
- description = " Runs tests with locale de.DE"
98
+ description = ' Runs tests with locale de.DE'
102
99
System . setProperty(' user.language' , ' de' )
103
100
System . setProperty(' user.country' , ' DE' )
104
101
systemProperties = System . properties
@@ -138,12 +135,12 @@ project(':api') {
138
135
139
136
jar {
140
137
manifest {
141
- attributes(' Implementation-Title' : base. archivesName,
142
- ' Implementation-Version' : archiveVersion. get(),
143
- ' Built-By' : ' MinIO, inc' ,
144
- ' Built-JDK' : System . getProperty(' java.version' ),
145
- ' Source-Compatibility' : sourceCompatibility,
146
- ' Target-Compatibility' : targetCompatibility)
138
+ attributes(' Implementation-Title' : base. archivesName. get() ,
139
+ ' Implementation-Version' : archiveVersion. get(),
140
+ ' Built-By' : ' MinIO, inc' ,
141
+ ' Built-JDK' : System . getProperty(' java.version' ),
142
+ ' Source-Compatibility' : sourceCompatibility,
143
+ ' Target-Compatibility' : targetCompatibility)
147
144
}
148
145
}
149
146
@@ -174,10 +171,17 @@ project(':api') {
174
171
archives javadocJar, sourcesJar, shadowJar
175
172
}
176
173
174
+ tasks. withType(Jar ) { task ->
175
+ task. doLast {
176
+ ant. checksum algorithm : ' md5' , file : it. archivePath
177
+ ant. checksum algorithm : ' sha1' , file : it. archivePath
178
+ }
179
+ }
180
+
177
181
publishing {
178
182
publications {
179
- mavenJava (MavenPublication ) {
180
- artifactId = base. archivesName
183
+ minioJava (MavenPublication ) {
184
+ artifactId = base. archivesName. get()
181
185
from components. java
182
186
pom {
183
187
name = ' minio'
@@ -209,22 +213,24 @@ project(':api') {
209
213
}
210
214
}
211
215
}
212
- }
213
216
214
- signing {
215
- if (project. properties. containsKey(' signing.keyId' )) {
216
- sign publishing. publications. mavenJava
217
+ repositories {
218
+ maven {
219
+ name = ' LocalMavenWithChecksums'
220
+ url = uri(layout. buildDirectory. dir(' staging-deploy' ))
221
+ }
222
+
223
+ maven {
224
+ name = ' PreDeploy'
225
+ url = uri(layout. buildDirectory. dir(' pre-deploy' ))
226
+ }
217
227
}
218
228
}
219
229
220
- nexusPublishing {
221
- packageGroup = group
222
- repositories {
223
- sonatype {
224
- stagingProfileId = ' 9b746c9f8abc1'
225
- username = project. properties[' nexusUsername' ]
226
- password = project. properties[' nexusPassword' ]
227
- }
230
+ signing {
231
+ setRequired {
232
+ gradle. taskGraph. allTasks. any { it. name. contains(' LocalMavenWithChecksums' ) }
233
+ sign publishing. publications. minioJava
228
234
}
229
235
}
230
236
}
@@ -242,18 +248,18 @@ project(':adminapi') {
242
248
243
249
dependencies {
244
250
api project(' :api' )
245
- api " com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2"
251
+ api ' com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2'
246
252
testImplementation project(' :api' )
247
253
}
248
254
249
255
jar {
250
256
manifest {
251
- attributes(' Implementation-Title' : base. archivesName,
252
- ' Implementation-Version' : archiveVersion. get(),
253
- ' Built-By' : ' MinIO, inc' ,
254
- ' Built-JDK' : System . getProperty(' java.version' ),
255
- ' Source-Compatibility' : sourceCompatibility,
256
- ' Target-Compatibility' : targetCompatibility)
257
+ attributes(' Implementation-Title' : base. archivesName. get() ,
258
+ ' Implementation-Version' : archiveVersion. get(),
259
+ ' Built-By' : ' MinIO, inc' ,
260
+ ' Built-JDK' : System . getProperty(' java.version' ),
261
+ ' Source-Compatibility' : sourceCompatibility,
262
+ ' Target-Compatibility' : targetCompatibility)
257
263
}
258
264
}
259
265
@@ -284,10 +290,17 @@ project(':adminapi') {
284
290
archives javadocJar, sourcesJar, shadowJar
285
291
}
286
292
293
+ tasks. withType(Jar ) { task ->
294
+ task. doLast {
295
+ ant. checksum algorithm : ' md5' , file : it. archivePath
296
+ ant. checksum algorithm : ' sha1' , file : it. archivePath
297
+ }
298
+ }
299
+
287
300
publishing {
288
301
publications {
289
- mavenJava (MavenPublication ) {
290
- artifactId = base. archivesName
302
+ minioJava (MavenPublication ) {
303
+ artifactId = base. archivesName. get()
291
304
from components. java
292
305
pom {
293
306
name = ' minio'
@@ -319,22 +332,31 @@ project(':adminapi') {
319
332
}
320
333
}
321
334
}
322
- }
323
335
324
- signing {
325
- if (project. properties. containsKey(' signing.keyId' )) {
326
- sign publishing. publications. mavenJava
336
+ repositories {
337
+ maven {
338
+ name = ' LocalMavenWithChecksums'
339
+ url = uri(layout. buildDirectory. dir(' staging-deploy' ))
340
+ }
341
+
342
+ maven {
343
+ name = ' PreDeploy'
344
+ url = uri(layout. buildDirectory. dir(' pre-deploy' ))
345
+ }
327
346
}
328
347
}
329
348
330
- nexusPublishing {
331
- packageGroup = group
349
+ signing {
350
+ setRequired {
351
+ gradle. taskGraph. allTasks. any { it. name. contains(' LocalMavenWithChecksumsRepository' ) }
352
+ sign publishing. publications. minioJava
353
+ }
332
354
}
333
355
}
334
356
335
357
project(' :examples' ) {
336
358
dependencies {
337
- compileOnly " me.tongfei:progressbar:0.9.5"
359
+ compileOnly ' me.tongfei:progressbar:0.9.5'
338
360
compileOnly project(' :api' )
339
361
}
340
362
@@ -354,7 +376,7 @@ import org.gradle.internal.os.OperatingSystem;
354
376
355
377
project(' :functional' ) {
356
378
dependencies {
357
- implementation " junit:junit:4.13.2"
379
+ implementation ' junit:junit:4.13.2'
358
380
implementation project(' :api' )
359
381
implementation project(' :adminapi' )
360
382
}
@@ -394,10 +416,84 @@ project(':functional') {
394
416
ext. region = rootProject. properties[' region' ]
395
417
}
396
418
397
- maxHeapSize = " 4096m"
398
- jvmArgs " -Xms256m"
419
+ maxHeapSize = ' 4096m'
420
+ jvmArgs ' -Xms256m'
399
421
if (rootProject. hasProperty(' endpoint' )) {
400
422
args = [ext. endpoint, ext. accessKey, ext. secretKey, ext. region]
401
423
}
402
424
}
403
425
}
426
+
427
+ jreleaser {
428
+ project {
429
+ copyright = ' MinIO Inc.'
430
+ description = ' MinIO Java SDK for Amazon S3 Compatible Cloud Storage'
431
+ }
432
+
433
+ signing {
434
+ active = ' ALWAYS'
435
+ armored = true
436
+ mode = ' FILE'
437
+ }
438
+
439
+ deploy {
440
+ maven {
441
+ nexus2 {
442
+ ' maven-central' {
443
+ stagingProfileId = ' 9b746c9f8abc1'
444
+ active = ' ALWAYS'
445
+ url = ' https://oss.sonatype.org/service/local'
446
+ snapshotUrl = ' https://s01.oss.sonatype.org/content/repositories/snapshots/'
447
+ closeRepository = true
448
+ releaseRepository = true
449
+ stagingRepository(' api/build/pre-deploy' )
450
+ }
451
+ }
452
+ }
453
+ maven {
454
+ nexus2 {
455
+ ' maven-central' {
456
+ stagingProfileId = ' 9b746c9f8abc1'
457
+ active = ' ALWAYS'
458
+ url = ' https://oss.sonatype.org/service/local'
459
+ snapshotUrl = ' https://s01.oss.sonatype.org/content/repositories/snapshots/'
460
+ closeRepository = true
461
+ releaseRepository = true
462
+ stagingRepository(' adminapi/build/pre-deploy' )
463
+ }
464
+ }
465
+ }
466
+ // For newly created repositories
467
+ // maven {
468
+ // mavenCentral {
469
+ // sonatype {
470
+ // applyMavenCentralRules = true
471
+ // active = 'ALWAYS'
472
+ // url = 'https://central.sonatype.com/api/v1/publisher'
473
+ // username = findProperty('nexusUsername') ?: System.getenv('NEXUS_USERNAME')
474
+ // password = findProperty('nexusPassword') ?: System.getenv('NEXUS_PASSWORD')
475
+ // stagingRepository('api/build/pre-deploy')
476
+ // }
477
+ // }
478
+ // }
479
+ //
480
+ // maven {
481
+ // mavenCentral {
482
+ // sonatype {
483
+ // applyMavenCentralRules = true
484
+ // active = 'ALWAYS'
485
+ // url = 'https://central.sonatype.com/api/v1/publisher'
486
+ // username = findProperty('nexusUsername') ?: System.getenv('NEXUS_USERNAME')
487
+ // password = findProperty('nexusPassword') ?: System.getenv('NEXUS_PASSWORD')
488
+ // stagingRepository('adminapi/build/pre-deploy')
489
+ // }
490
+ // }
491
+ // }
492
+ }
493
+
494
+ release {
495
+ github {
496
+ enabled = false
497
+ }
498
+ }
499
+ }
0 commit comments