Fix gradle build when not publishing to sonatype and properties are missing
Gitea/Java-Installer/pipeline/head This commit looks good Details

snapshot
Jonas Letzbor 2024-01-19 17:25:25 +01:00
parent 017956ffef
commit aaf2073b51
Signed by: RPJosh
GPG Key ID: 43ACB900522EA740
2 changed files with 5 additions and 13 deletions

View File

@ -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

View File

@ -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'