1

I have a build.sbt written in bare style, i.e. containing only SettingKeys. I want to add IntegrationTest configuration to project, but I can't manage to do so without declaring a project and calling configs method on it like following:

lazy val root = (project in file(".")).configs(IntegrationTest).settings(
  build.projectSettings,
  Defaults.itSettings
)

Simply adding Defaults.itSettings to build.sbt results in exception about nonexistent configuration

java.lang.IllegalArgumentException: Cannot add dependency 'org.cassandraunit#cassandra-unit;3.3.0.2' to configuration 'it' of module com-mymodule because this configuration doesn't exist!

How can I both keep my build.sbt in bare style and add IntegrationTest config?

Roman Lebedev
  • 903
  • 1
  • 6
  • 16

1 Answers1

4

You can add configs to the build.sbt directly:

configs(IntegrationTest)
Defaults.itSettings

You should understand though that if you have a multi-project build, it's better to declare all projects and their common settings explicitly.

laughedelic
  • 6,230
  • 1
  • 32
  • 41