Fix gradle build when not publishing to sonatype and properties are missing
Gitea/Java-Installer/pipeline/head This commit looks good
Details
Gitea/Java-Installer/pipeline/head This commit looks good
Details
parent
017956ffef
commit
aaf2073b51
|
@ -10,6 +10,7 @@ plugins {
|
||||||
|
|
||||||
version = project.file("./VERSION").text.trim()
|
version = project.file("./VERSION").text.trim()
|
||||||
def version = project.file("./VERSION").text.trim()
|
def version = project.file("./VERSION").text.trim()
|
||||||
|
def publishToNexus = "publishToSonatype" in gradle.startParameter.taskNames
|
||||||
|
|
||||||
group = "de.rpjosh"
|
group = "de.rpjosh"
|
||||||
|
|
||||||
|
@ -98,8 +99,8 @@ nexusPublishing {
|
||||||
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
|
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
|
||||||
|
|
||||||
// Or use System.getenv?
|
// Or use System.getenv?
|
||||||
username=project.property("maven.sonatype.user")
|
username= publishToNexus ? project.property("maven.sonatype.user") : "none"
|
||||||
password=project.property("maven.sonatype.password")
|
password= publishToNexus ? project.property("maven.sonatype.password") : "none"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,8 +140,8 @@ publishing {
|
||||||
}
|
}
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
def signingKey = project.property("maven.sonatype.signing.key")
|
def signingKey = publishToNexus ? project.property("maven.sonatype.signing.key") : ""
|
||||||
def signingPassword = project.property("maven.sonatype.signing.password")
|
def signingPassword = publishToNexus ? project.property("maven.sonatype.signing.password") : ""
|
||||||
useInMemoryPgpKeys(signingKey, signingPassword)
|
useInMemoryPgpKeys(signingKey, signingPassword)
|
||||||
|
|
||||||
// Only sign the publications
|
// Only sign the publications
|
||||||
|
|
|
@ -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'
|
rootProject.name = 'de.rpjosh.installer'
|
||||||
|
|
Loading…
Reference in New Issue