diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index b55c50560bb936b608dfb6ccec529c754e0b9df9..44abbc152f99f00541cb2e79e0b21a5d056d20de 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -86,9 +86,8 @@ object SparkBuild extends PomBuild { profiles } - override val profiles = Properties.envOrNone("MAVEN_PROFILES") match { + override val profiles = Properties.envOrNone("SBT_MAVEN_PROFILES") match { case None => backwardCompatibility - // Rationale: If -P option exists no need to support backwardCompatibility. case Some(v) => if (backwardCompatibility.nonEmpty) println("Note: We ignore environment variables, when use of profile is detected in " + @@ -96,6 +95,12 @@ object SparkBuild extends PomBuild { v.split("(\\s+|,)").filterNot(_.isEmpty).map(_.trim.replaceAll("-P", "")).toSeq } + Properties.envOrNone("SBT_MAVEN_PROPERTIES") match { + case Some(v) => + v.split("(\\s+|,)").filterNot(_.isEmpty).map(_.split("=")).foreach(x => System.setProperty(x(0), x(1))) + case _ => + } + override val userPropertiesMap = System.getProperties.toMap lazy val sharedSettings = graphSettings ++ ScalaStyleSettings ++ Seq ( diff --git a/sbt/sbt-launch-lib.bash b/sbt/sbt-launch-lib.bash index 857b62ffa229c6b1b1dac709941588196f32cabe..c91fecf024ad4c8318ca0af860fd7777fc6d5059 100755 --- a/sbt/sbt-launch-lib.bash +++ b/sbt/sbt-launch-lib.bash @@ -92,7 +92,7 @@ addJava () { enableProfile () { dlog "[enableProfile] arg = '$1'" maven_profiles=( "${maven_profiles[@]}" "$1" ) - export MAVEN_PROFILES="${maven_profiles[@]}" + export SBT_MAVEN_PROFILES="${maven_profiles[@]}" } addSbt () {