From e94bdd91d65530f9b4723fa4b08faa3a3b45ee6c Mon Sep 17 00:00:00 2001 From: Russell Spitzer Date: Tue, 30 Aug 2016 17:05:52 -0700 Subject: [PATCH] Set PackagedArtifact instead of PackagedArtifacts Advice from some helpful folks on sbt/sbt gitter noted that we should be setting packagedArtifact in pacakageBin to reassign the publish artifacts. --- project/SparkCassandraConnectorBuild.scala | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/project/SparkCassandraConnectorBuild.scala b/project/SparkCassandraConnectorBuild.scala index f8a694294..300eaf78d 100644 --- a/project/SparkCassandraConnectorBuild.scala +++ b/project/SparkCassandraConnectorBuild.scala @@ -86,17 +86,11 @@ object CassandraSparkBuild extends Build { log.info(s"""Shaded jar moved to $expected""".stripMargin) expected }, + packagedArtifact in packageBin in Compile := { + (artifact.value, (assembly in shadedConnector).value) + }, sbt.Keys.`package` := packageBin.value) ++ pureCassandraSettings - //Update the distribution tasks to use the shaded jar - ++ {for (taskKey <- Seq(publishLocal in Compile, publish in Compile, publishM2 in Compile)) yield { - packagedArtifacts in taskKey := { - val previous = (packagedArtifacts in Compile).value - val shadedJar = (artifact.value.copy(configurations = Seq(Compile)) -> packageBin.value) - //Clobber the old build artifact with the shaded jar - previous + shadedJar - } - }} ).copy(dependencies = Seq(embedded % "test->test;it->it,test;") ) configs IntegrationTest