Allow env to be null

This commit is contained in:
Telesphoreo 2022-02-22 00:12:51 -06:00
parent 455713db3c
commit ab0666ebeb

View File

@ -67,6 +67,7 @@ publishing {
from(components.java) from(components.java)
repositories { repositories {
maven { maven {
if (System.getenv("plex_repo_user") != null && System.getenv("plex_repo_pass") != null) {
url("https://nexus.telesphoreo.me/repository/plex-releases/") url("https://nexus.telesphoreo.me/repository/plex-releases/")
credentials { credentials {
username = System.getenv("plex_repo_user") username = System.getenv("plex_repo_user")
@ -75,10 +76,12 @@ publishing {
} }
} }
} }
}
plexSnapshots(MavenPublication) { plexSnapshots(MavenPublication) {
from(components.java) from(components.java)
repositories { repositories {
maven { maven {
if (System.getenv("plex_repo_user") != null && System.getenv("plex_repo_pass") != null) {
url("https://nexus.telesphoreo.me/repository/plex-snapshots/") url("https://nexus.telesphoreo.me/repository/plex-snapshots/")
credentials { credentials {
username = System.getenv("plex_repo_user") username = System.getenv("plex_repo_user")
@ -88,6 +91,7 @@ publishing {
} }
} }
} }
}
} }
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
@ -97,8 +101,7 @@ tasks.withType(JavaCompile) {
tasks { tasks {
build { build {
dependsOn(shadowJar) dependsOn(shadowJar)
if (getVersion().toString().toLowerCase().endsWith("-snapshot")) if (getVersion().toString().toLowerCase().endsWith("-snapshot")) {
{
dependsOn(publishPlexSnapshotsPublicationToMaven2Repository) dependsOn(publishPlexSnapshotsPublicationToMaven2Repository)
} }
} }