LibraryDependencies on sbt Build.scala Full customization with sub-projects

I have a foo project with two children foo-core and foo-cli, foo-cli depends on foo-core (I came from Java / Maven and tried to migrate the parent module with the 2nd submodule architecture). Following https://github.com/harrah/xsbt/wiki/Full-Configuration , I wrote my project /Build.scala as follows:

import sbt._ import Keys._ object MyBuild extends Build { //Dependencies val slf4s = "com.weiglewilczek.slf4s" %% "slf4s" % "1.0.6" val slf4j = "org.slf4j" %% "slf4j-simple" % "1.5.6" val grizzled = "org.clapper" %% "grizzled-slf4j" % "0.5" val junit = "junit" % "junit" % "4.8" % "test" //End dependencies lazy val root : Project = Project("root", file(".")) aggregate(cli) settings( mainClass:= Some("Main") ) lazy val core : Project = Project("core", file("core"), delegates = root :: Nil) settings( name := "foo-core", libraryDependencies ++= Seq(grizzled) ) lazy val cli: Project = Project("cli", file("cli")) dependsOn(core) settings( name := "foo-cli", libraryDependencies ++= Seq(grizzled) ) } 

This configuration does not work: grizzled library does not load when sbt reload starts; sbt + update (as stated at http://software.clapper.org/grizzled-slf4j/ ), and thus "import grizzli._" fails in my core and cli projects when I compile the command.

Since I am new to scala / sbt, I believe that I am doing something terrible, but I can’t understand why, because I am confused with all the conflicting sbt 0.7 / sbt0.10 configurations that were proposed (for example, dependent subprojects in SBT ).

Any idea? Hint that can help me?

Thank you in advance

+4
source share
1 answer

This is a gray-haired, not a grizzly, which you use as an addiction. Import:

 import grizzled._ 

It works here from console to project cli and project core , nothing more than the configuration file above.

Are you using SBT 0.10?

+2
source

All Articles