You can define the modules independently in build.sbt as follows:
lazy val module1 = project
.settings(
libraryDependencies ++= deps
)
lazy val module2 = project
.settings(
libraryDependencies ++= deps
)
lazy val module3 = (project in file("modules/module3"))
.settings(
libraryDependencies ++= deps
)
val deps = List(
"dependencia1" %% "exemplo" % "X.Y.Z",
"dependencia2" %% "exemplo" % "X.Y.Z",
)
In the example above modules are defined including the list of dependencies. modulo3 explicitly defines the path from which sbt searches its main App
.
Another way is to define a dependency relationship between modules:
lazy val module2 = project
.settings(
libraryDependencies ++= deps
)
lazy val module3 = (project in file("modules/module3"))
.settings()
.dependsOn(module2)
In this case it is not necessary to reset the value libraryDependencies
pro module3