Skip to content

Commit bba3b66

Browse files
authored
chore: Update Gradle to release on Maven Central (#1311)
1 parent 50c2249 commit bba3b66

File tree

5 files changed

+309
-208
lines changed

5 files changed

+309
-208
lines changed

build.gradle

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ plugins {
77
id "signing"
88
id "eclipse"
99
id "idea"
10+
id 'org.jreleaser' version '1.18.0'
1011
}
1112

1213
sourceCompatibility = 1.8
@@ -195,16 +196,7 @@ publishing {
195196

196197
repositories {
197198
maven {
198-
name = "sonatype"
199-
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
200-
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
201-
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
202-
if (project.hasProperty("ossrhUsername") && project.hasProperty("ossrhPassword")) {
203-
credentials {
204-
username = ossrhUsername
205-
password = ossrhPassword
206-
}
207-
}
199+
url = layout.buildDirectory.dir('staging-deploy')
208200
}
209201
}
210202
}
@@ -218,6 +210,29 @@ signing {
218210
sign publishing.publications.boxJavaSdk
219211
}
220212

213+
def centralUsername = project.findProperty("centralUsername")
214+
def centralPassword = project.findProperty("centralPassword")
215+
jreleaser {
216+
signing {
217+
active = "NEVER"
218+
}
219+
deploy {
220+
maven {
221+
mavenCentral {
222+
sonatype {
223+
sign = false
224+
active = 'RELEASE'
225+
url = 'https://central.sonatype.com/api/v1/publisher'
226+
stagingRepository('build/staging-deploy')
227+
username = centralUsername
228+
password = centralPassword
229+
}
230+
}
231+
232+
}
233+
}
234+
}
235+
221236
idea {
222237
module {
223238
sourceDirs -= file("src/intTest/java")

gradle/wrapper/gradle-wrapper.jar

-11 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Tue Jan 11 17:10:51 CET 2022
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip

0 commit comments

Comments
 (0)