There is a similar question here but that solution does not work in sbt v1.x
In the build sbt it is well documented how to exclude dependencies when added through libraryDependencies
:
libraryDependencies += "log4j" % "log4j" % "1.2.15" exclude("javax.jms", "jms")
or preventing transitive dependencies:
libraryDependencies += "org.apache.felix" % "org.apache.felix.framework" % "1.8.0" intransitive()
but my question is how (and if) it can be done when declaring dependsOn
dependencies of submodules in a multi-module project like this:
lazy val core = project.dependsOn(util)
How would I do something like this (invalid code in example below) to prevent a transitive dependency from being brought in via util
:
lazy val core = project.dependsOn(util exclude("javax.jms", "jms"))
also how, and more importantly, how to exclude a transitive dependency on another submodule in the multi-module project from being brought in via util
(where sub3
is another submodule project declared in the same build.sbt):
lazy val core = project.dependsOn(util exclude sub3)