Skip to content

Commit dbfc7c7

Browse files
committed
migrate to ossrh-staging-api.central.sonatype.com for publishing
1 parent baf7659 commit dbfc7c7

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

build.gradle

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
plugins {
22
id 'maven-publish'
3+
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
34
id 'signing'
45
id 'java'
56
}
67

8+
group = 'de.inetsoftware'
9+
archivesBaseName = 'exceljconnect'
10+
version = '1.7'
11+
712
java {
813
sourceCompatibility = JavaVersion.VERSION_11
914
targetCompatibility = JavaVersion.VERSION_11
@@ -46,13 +51,21 @@ java {
4651
withSourcesJar()
4752
}
4853

54+
nexusPublishing {
55+
repositories {
56+
sonatype {
57+
nexusUrl = uri('https://ossrh-staging-api.central.sonatype.com/service/local/')
58+
snapshotRepositoryUrl = uri('https://central.sonatype.com/repository/maven-snapshots/')
59+
username = project.findProperty('ossrhUsername')
60+
password = project.findProperty('ossrhPassword')
61+
}
62+
}
63+
}
4964
publishing {
5065
publications {
5166
maven(MavenPublication) {
52-
groupId = 'de.inetsoftware'
53-
artifactId = 'exceljconnect'
54-
version = '1.7'
5567
from components.java
68+
5669
pom {
5770
name = 'Excel driver for Java'
5871
description = 'A Excel driver (*.xlsx) written completely in Java (pure Java).'
@@ -79,17 +92,6 @@ publishing {
7992
}
8093
}
8194
}
82-
83-
repositories {
84-
maven {
85-
name = 'sonatype'
86-
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
87-
credentials {
88-
username = project.findProperty("ossrhUsername")
89-
password = project.findProperty("ossrhPassword")
90-
}
91-
}
92-
}
9395
}
9496

9597
signing {
@@ -100,6 +102,9 @@ signing {
100102
sign publishing.publications.maven
101103
}
102104

105+
closeStagingRepositories.dependsOn 'publishToSonatype'
106+
publish.dependsOn 'closeStagingRepositories'
107+
103108
test {
104109
useJUnitPlatform()
105110
}

0 commit comments

Comments
 (0)