diff --git a/build.gradle b/build.gradle index 5bae8c8..d48dfa9 100644 --- a/build.gradle +++ b/build.gradle @@ -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 { @@ -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 diff --git a/gradle.properties b/gradle.properties index 21f65e8..fb8afb6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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=marten@dmfs.org diff --git a/publish.gradle b/publish.gradle index 5110262..1ad5bfa 100644 --- a/publish.gradle +++ b/publish.gradle @@ -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