I have an SBT Scala multiproject with the following structure:
multiprojectRoot
project/SharedProjectBuildCode.scala
project1
src/sourceFiles
project1-build.sbt
project2
src/sourceFiles
project2-build.sbt
projectN
src/sourceFiles
projectN-build.sbt
multiprojectRoot / project / SharedProjectBuildCode.scala: contains multi-project definitions that use dependOn to create dependencies on local projects. For example:
lazy val project2 = Project(
...
).dependsOn(project1)
multiprojectRoot / project2 / project2-build.sbt: contains settings and dependencies for this project. For example:
name := "project2"
libraryDependencies ++= Seq(
...
"my.company" % "project1" % "1.0"
)
The first dependency on project1 is declared with dependOn in the SharedProjectBuildCode.scala file, and the second is created in the stand-alone build definition file build2 build.sbt.
Thus, the definition of project2 contains:
- ambiguous dependence on project1 or
- double dependency on project1
We want to keep this project structure because it is the best for our current workflow:
- .sbt .
- .scala dependOn , , publishLocal.
. ?