This appears similar to sbt Configuration vs Ivy configuration, though it doesn't seem like this question is asked:
What is the difference between
libraryDependencies += "com.example" % "foo" % "1.0" % "test"
and
libraryDependencies in Test += "com.example" % "foo" % "1.0"
(And a similar question for IntegrationTest
/ "it"
.)
Should I always use SBT configuration, or Ivy configuration? Or does it depend on the particular case?
I have seen the former more often, though it seems that the latter is more consistent with the rest of my build.sbt.
update
task andlibraryDependencies
are a bit odd ones because when you're downloading JARs you probably don't want to downloadCompile
JARs andTest
JARs independently or in parallel. Forupdate
task to handle all configurations,libraryDependencies
needs to handle all configurations too.means your project's
Test
configuration depends on the default configuration of"com.example" % "foo" % "1.0"
.libraryDependencies in Test
, I don't think would work.There are notational differences, but conceptually sbt's configuration and Ivy configuration is the same thing.