Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8a5d0f1

Browse files
committed
migrate to maven-publish to push to maven
1 parent d26d52c commit 8a5d0f1

1 file changed

Lines changed: 51 additions & 50 deletions

File tree

build.gradle

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
plugins {
2222
id "com.github.johnrengelman.shadow" version "5.2.0"
2323
id "com.github.spotbugs" version "4.0.1"
24-
id "io.codearte.nexus-staging" version "0.21.2"
24+
id "io.codearte.nexus-staging" version "0.22.0"
25+
id "de.marcphilipp.nexus-publish" version "0.4.0"
2526
id "com.diffplug.gradle.spotless" version "4.4.0"
2627
}
2728

2829
/*
2930
* Root project definitions
3031
*/
3132
apply plugin: 'io.codearte.nexus-staging'
33+
apply plugin: "de.marcphilipp.nexus-publish"
3234

3335
allprojects {
3436
group = 'io.minio'
@@ -93,7 +95,7 @@ subprojects {
9395

9496
check.dependsOn localeTest
9597

96-
sourceCompatibility = 1.8
98+
sourceCompatibility = JavaVersion.VERSION_1_8
9799

98100
spotless {
99101
java {
@@ -109,17 +111,15 @@ subprojects {
109111
}
110112

111113
project(':api') {
112-
apply plugin: 'com.github.johnrengelman.shadow'
114+
apply plugin: 'java'
113115
apply plugin: 'maven'
116+
apply plugin: 'maven-publish'
114117
apply plugin: 'signing'
118+
apply plugin: 'com.github.johnrengelman.shadow'
119+
apply plugin: "de.marcphilipp.nexus-publish"
115120

116121
archivesBaseName = 'minio'
117122

118-
nexusStaging {
119-
packageGroup = group
120-
stagingProfileId = '9b746c9f8abc1'
121-
}
122-
123123
configurations.all {
124124
resolutionStrategy {
125125
force 'com.fasterxml.jackson.core:jackson-annotations:2.9.6'
@@ -162,65 +162,66 @@ project(':api') {
162162
}
163163
}
164164

165-
artifacts {
166-
archives javadocJar, sourcesJar, shadowJar
167-
}
168-
169-
signing {
170-
if (project.properties.containsKey('signing.keyId')) {
171-
sign configurations.archives
172-
}
173-
}
174-
175-
uploadArchives {
176-
repositories {
177-
mavenDeployer {
178-
beforeDeployment {
179-
MavenDeployment deployment -> signing.signPom(deployment)
180-
}
181-
182-
ext.nexusUsername = project.properties['nexusUsername']
183-
ext.nexusPassword = project.properties['nexusPassword']
184-
185-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
186-
authentication(userName: ext.nexusUsername, password: ext.nexusPassword)
187-
}
188-
189-
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
190-
authentication(userName: ext.nexusUsername, password: ext.nexusPassword)
191-
}
192-
193-
pom.project {
194-
name 'minio'
195-
packaging 'jar'
196-
description 'MinIO Java SDK for Amazon S3 Compatible Cloud Storage'
197-
url 'https://github.com/minio/minio-java'
198-
inceptionYear '2015'
165+
publishing {
166+
publications {
167+
mavenJava(MavenPublication) {
168+
from components.java
169+
artifact sourcesJar
170+
artifact shadowJar
171+
artifact javadocJar
172+
pom {
173+
name = 'minio'
174+
packaging = 'jar'
175+
description = 'MinIO Java SDK for Amazon S3 Compatible Cloud Storage'
176+
url = 'https://github.com/minio/minio-java'
177+
inceptionYear = '2015'
199178

200179
scm {
201-
connection 'scm:git:[email protected]:minio/minio-java.git'
202-
developerConnection 'scm:git:[email protected]:minio/minio-java.git'
203-
url 'http://github.com/minio/minio-java'
180+
connection = 'scm:git:[email protected]:minio/minio-java.git'
181+
developerConnection = 'scm:git:[email protected]:minio/minio-java.git'
182+
url = 'http://github.com/minio/minio-java'
204183
}
205184

206185
licenses {
207186
license {
208-
name 'The Apache License, Version 2.0'
209-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
187+
name = 'The Apache License, Version 2.0'
188+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
210189
}
211190
}
212191

213192
developers {
214193
developer {
215-
id 'minio'
216-
name 'MinIO Inc.'
217-
194+
id = 'minio'
195+
name = 'MinIO Inc.'
196+
218197
}
219198
}
220199
}
221200
}
222201
}
223202
}
203+
204+
signing {
205+
if (project.properties.containsKey('signing.keyId')) {
206+
sign publishing.publications.mavenJava
207+
}
208+
}
209+
210+
nexusStaging {
211+
packageGroup = group
212+
stagingProfileId = '9b746c9f8abc1'
213+
username = project.properties['nexusUsername']
214+
password = project.properties['nexusPassword']
215+
}
216+
217+
nexusPublishing {
218+
repositories {
219+
sonatype {
220+
username = project.properties['nexusUsername']
221+
password = project.properties['nexusPassword']
222+
}
223+
}
224+
}
224225
}
225226

226227
project(':examples') {

0 commit comments

Comments
 (0)