Skip to content

Commit 0a28688

Browse files
authored
Publish with Nexus Plugin, closes #110 (#113)
1 parent 0a41e3f commit 0a28688

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'java-library'
33
id 'org.dmfs.gver' version '0.18.0'
4+
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' apply false
45
}
56

67
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -56,6 +57,19 @@ allprojects {
5657
}
5758
}
5859

60+
if (project.hasProperty('SONATYPE_USERNAME') && project.hasProperty('SONATYPE_PASSWORD')) {
61+
apply plugin: 'io.github.gradle-nexus.publish-plugin'
62+
63+
nexusPublishing {
64+
repositories {
65+
sonatype {
66+
username = SONATYPE_USERNAME
67+
password = SONATYPE_PASSWORD
68+
}
69+
}
70+
}
71+
}
72+
5973
dependencies {
6074
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
6175
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'

publish.gradle

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@ if (project.hasProperty('SONATYPE_USERNAME') && project.hasProperty('SONATYPE_PA
1414
}
1515

1616
publishing {
17-
repositories {
18-
maven {
19-
name 'release'
20-
url RELEASE_REPOSITORY
21-
credentials {
22-
username SONATYPE_USERNAME
23-
password SONATYPE_PASSWORD
24-
}
25-
}
26-
}
2717

2818
publications {
2919
jar(MavenPublication) {
@@ -61,6 +51,7 @@ if (project.hasProperty('SONATYPE_USERNAME') && project.hasProperty('SONATYPE_PA
6151
}
6252

6353
signing {
54+
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
6455
sign publishing.publications
6556
}
6657
}

0 commit comments

Comments
 (0)