A single sbt build has a single project/
directory for .scala
build definitions and plugin definitions. There can be multiple subprojects within that build with their own .sbt
files, but not their own project/*.scala
files.
When you want to include other, separate builds directly instead of using their published binaries, you use "source dependencies". This is what RootProject
and ProjectRef
declare. ProjectRef
is the most general: you specify the location of the build (a URI) and the ID of the project in the build (a String) that you want to depend on. RootProject
is a convenience that selects the root project for the build at the URI you specify.
Source dependencies do have an overhead: startup time, memory usage, and command line usability. If the group of projects don't need to be separate, it is best to use a single build with standard subprojects.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…