Skip to content

Commit 529cb4b

Browse files
committed
migrate to ossrh-staging-api.central.sonatype.com for publishing
1 parent 4b2080f commit 529cb4b

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

build.gradle

Lines changed: 23 additions & 15 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 = 'sass-compiler'
10+
version = '1.3'
11+
712
java {
813
sourceCompatibility = JavaVersion.VERSION_1_8
914
targetCompatibility = JavaVersion.VERSION_1_8
@@ -24,13 +29,21 @@ java {
2429
withSourcesJar()
2530
}
2631

32+
nexusPublishing {
33+
repositories {
34+
sonatype {
35+
nexusUrl = uri('https://ossrh-staging-api.central.sonatype.com/service/local/')
36+
snapshotRepositoryUrl = uri('https://central.sonatype.com/repository/maven-snapshots/')
37+
username = project.findProperty('ossrhUsername')
38+
password = project.findProperty('ossrhPassword')
39+
}
40+
}
41+
}
2742
publishing {
2843
publications {
2944
maven(MavenPublication) {
30-
groupId = 'de.inetsoftware'
31-
artifactId = 'sass-compiler'
32-
version = '1.3'
3345
from components.java
46+
3447
pom {
3548
name = 'Java Sass Compiler'
3649
description = 'A Sass compiler written completely in Java (pure Java).'
@@ -58,20 +71,15 @@ publishing {
5871
}
5972
}
6073
}
61-
62-
repositories {
63-
maven {
64-
name = 'sonatype'
65-
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
66-
credentials {
67-
username = project.findProperty("ossrhUsername")
68-
password = project.findProperty("ossrhPassword")
69-
}
70-
}
71-
}
7274
}
7375

7476
signing {
75-
required { project.hasProperty("signing.keyId") }
77+
required { project.hasProperty('signing.keyId') || project.hasProperty('signing.key') }
78+
if( project.hasProperty('signing.key') ) {
79+
useInMemoryPgpKeys( project.findProperty('signing.key'), project.findProperty('signing.password') )
80+
}
7681
sign publishing.publications.maven
7782
}
83+
84+
closeStagingRepositories.dependsOn 'publishToSonatype'
85+
publish.dependsOn 'closeStagingRepositories'

0 commit comments

Comments
 (0)