I have a multi-project contains a private macro sub-project which\'s usage is limited to implement method body of other sub-projects. Neither should it be on the runtime classpa
val lib = Project("lib", file("lib")).dependsOn(macro % "compile-internal")
Just had this discussion last night...
That error is because the project doesn't have that config.
val CompileOnly = config("compileonly").hide
ivyConfigurations += CompileOnly
val macro = Project("macro", file("macro")).configs(CompileOnly) // add config
val lib = Project("lib", file("lib")).dependsOn(macro % CompileOnly)
But then the problem is
macro#macro_2.10;0.1-SNAPSHOT: configuration not public in macro#macro_2.10;0.1-SNAPSHOT: 'compileonly'. It was required from lib#lib_2.10;0.1-SNAPSHOT compile
The solution is
val CompileOnly = config("compileonly")
val macro = Project("macro", file("macro")).configs(CompileOnly)
val lib = Project("lib", file("lib")).dependsOn(macro % CompileOnly)
.settings(ivyConfigurations += CompileOnly.hide)
You may also want to familiarize yourself with the provided
configuration. It's a standard Maven/Ivy config that means that the jar will be provide on the classpath at runtime (e.g. like the JDK, or a servlet container), but not at compile time.