diff --git a/build.gradle b/build.gradle index 23477b0..5faf6c0 100644 --- a/build.gradle +++ b/build.gradle @@ -10,6 +10,7 @@ plugins { version = project.file("./VERSION").text.trim() def version = project.file("./VERSION").text.trim() +def publishToNexus = "publishToSonatype" in gradle.startParameter.taskNames group = "de.rpjosh" @@ -98,8 +99,8 @@ nexusPublishing { snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) // Or use System.getenv? - username=project.property("maven.sonatype.user") - password=project.property("maven.sonatype.password") + username= publishToNexus ? project.property("maven.sonatype.user") : "none" + password= publishToNexus ? project.property("maven.sonatype.password") : "none" } } } @@ -139,8 +140,8 @@ publishing { } signing { - def signingKey = project.property("maven.sonatype.signing.key") - def signingPassword = project.property("maven.sonatype.signing.password") + def signingKey = publishToNexus ? project.property("maven.sonatype.signing.key") : "" + def signingPassword = publishToNexus ? project.property("maven.sonatype.signing.password") : "" useInMemoryPgpKeys(signingKey, signingPassword) // Only sign the publications diff --git a/settings.gradle b/settings.gradle index 70dd66f..89cd875 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,10 +1 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user manual at https://docs.gradle.org/6.6.1/userguide/multi_project_builds.html - */ - rootProject.name = 'de.rpjosh.installer'