Skip to content

Commit

Permalink
Use Nexus Plugin to publish artifacts, closes #88
Browse files Browse the repository at this point in the history
  • Loading branch information
dmfs committed Nov 27, 2022
1 parent 194da0c commit 160cf9c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
13 changes: 13 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'java-library'
id 'org.dmfs.gitversion' version '0.7.0'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' apply false
}

gitVersion {
Expand Down Expand Up @@ -81,6 +82,18 @@ task generateSources(type: Copy) {
}
compileJava.dependsOn generateSources

if (project.hasProperty('SONATYPE_USERNAME') && project.hasProperty('SONATYPE_PASSWORD')) {
apply plugin: 'io.github.gradle-nexus.publish-plugin'

nexusPublishing {
repositories {
sonatype {
username = SONATYPE_USERNAME
password = SONATYPE_PASSWORD
}
}
}
}

dependencies {
api 'org.dmfs:jems:' + JEMS_VERSION
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
HTTP_CLIENT_ESSENTIALS_VERSION=0.20
JEMS_VERSION=1.41

RELEASE_REPOSITORY=https://oss.sonatype.org/service/local/staging/deploy/maven2
POM_DEVELOPER_ID=dmfs
POM_DEVELOPER_NAME=Marten Gajda
POM_DEVELOPER_EMAIL=[email protected]
Expand Down
11 changes: 0 additions & 11 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ if (project.hasProperty('SONATYPE_USERNAME') && project.hasProperty('SONATYPE_PA
}

publishing {
repositories {
maven {
name 'release'
url RELEASE_REPOSITORY
credentials {
username SONATYPE_USERNAME
password SONATYPE_PASSWORD
}
}
}

publications {
jar(MavenPublication) {
from components.java
Expand Down

0 comments on commit 160cf9c

Please sign in to comment.