Working on some scala software in IDEA IntelliJ. (It also features Android if it is essential). Suppose I have two projects:
P1, written in scala, uses sbt as the build
Per my understanding, better (but different) solution would be to publish jar in your local repository (e.g. publishLocal), and depend on it.
install
it into your local maven
repository build.sbt
add an Library Depdendency to P2/Java, e.g. libraryDependencies += "xyz" % "xyz" % "xyz"
. Now all dependencies of P2 are also accessible in P1build.sbt
would remove this explicity added IntellIJ-project-struture-module-dependency to P2. So I propose to turn sbt auto-import
off in Intellij and the dependency is kept any time you restart IntelliJPossibility three - define a multi module SBT project for both of your projects, and manage the java project also within sbt. This is a tedious solution, however, as you have to maintain two different build files, so this is only useful if you intend to switch whole hog to SBT.
Otherwise the "publishLocal" solution is probably the least painful.
When I try to compile that, sbt tells me that it cannot find definitions of that dependency.
Two possible solutions I see: add those dependencies in your build.sbt project or as suggested build the gradle project separately, publish it to your local repository (or local folder) and reference it from sbt project.