To make our multi-project build more manageable, we split our Build.scala file into several files, for example. Dependencies.scala contains all the dependencies:
import sbt._
object Dependencies {
val slf4j_api = "org.slf4j" % "slf4j-api" % "1.7.7"
...
}
We want to add integration tests to our assembly. After the SBT documentation we added
object Build extends sbt.Build {
import Dependencies._
import BuildSettings._
import Version._
import MergeStrategies.custom
lazy val root = Project(
id = "root",
base = file("."),
settings = buildSettings ++ Seq(Git.checkNoLocalChanges, TestReport.testReport)
).configs(IntegrationTest).settings(Defaults.itSettings: _*)
...
}
where Dependencies, BuildSettings, Version and MergeStrategies are Scala custom objects defined in their own files.
Following the documentation, we want to add some dependencies for the IntegrationTest configuration in Dependencies.scala:
import sbt._
object Dependencies {
val slf4j_api = "org.slf4j" % "slf4j-api" % "1.7.7"
val junit = "junit" % "junit" % "4.11" % "test,it"
...
}
Unfortunately, this destroys the assembly:
java.lang.IllegalArgumentException: 'junit # junit; 4.11' 'it' ... !
, IntegrationTest. IntegrationTest Dependencies.scala:
import sbt.Configurations.IntegrationTest
IntegrationTest - val, Configurations:
object Configurations {
...
lazy val IntegrationTest = config("it") extend (Runtime)
...
}
.
- , ?