I have 3 modules (jvm
,stateAccess
, persistence
), with the following dependency:
jvm->stateAccess->persistence
.
I would like to isolate jvm
from persistence
completely, as if from the point of view of jvm
persistence
did not exist. So jvm
should not be able to import anything from persistence
.
However with the following build.sbt
file, this is not the case:
lazy val jvm = (project in file( "jvm" ))
.settings(...)
.dependsOn( stateAccess % "compile->compile;test->test" )
lazy val persistence = (project in file( "persistence" ))
.settings(...)
lazy val stateAccess = (project in file( "stateAccess" ))
.settings(...)
.dependsOn( persistence )
The problem is that jvm
can see persistence
.
It is due to a transitivity of the dependency relation in SBT: jvm
can import classes from persistence
and use them even though jvm
does not depend directly on persistence
.
In other words, I want to make sure that jvm
only depends on stateAccess
and cannot use anything from persistence
.
Is there a way to forbid such transitive dependencies ?