From 05cb366fd2c05ca5eda147453f33fce7b28173fe Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Thu, 19 Jan 2017 20:53:09 -0800 Subject: [PATCH] Set credentail only when SONTAYPE_USERNAME/PASSWORD are set --- build.sbt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index b87b282..0dc4d04 100644 --- a/build.sbt +++ b/build.sbt @@ -10,10 +10,14 @@ description := "snappy-java: A fast compression/decompression library" sonatypeProfileName := "org.xerial" -credentials += Credentials("Sonatype Nexus Repository Manager", - "oss.sonatype.org", - sys.env.getOrElse("SONATYPE_USERNAME", ""), - sys.env.getOrElse("SONATYPE_PASSWORD", "")) +credentials ++= { + if(sys.env.contains("SONATYPE_USERNAME") && sys.env.contains("SONATYPE_PASSWORD")) { + Seq(Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", sys.env("SONATYPE_USERNAME"), sys.env("SONATYPE_PASSWORD"))) + } + else { + Seq.empty + } +} pomExtra := { https://github.com/xerial/snappy-java