Your project setup allows you to access EntityRepository trait which is in domain subproject from anywhere in infra subproject because infra depends on domain. All you need to do is to reference EntityRepository by its full name or import the package where it resides (import com.example.EntityRepository).

If you use IntelliJ you can generate projects for it from sbt using sbt-idea plugin. The same goes for Eclipse with sbteclipse-plugin. This way your generated IDE projects would have proper references to each other and will help you find your classes.

Although you have the same package in two different SBT subprojects it's not a problem. This should not cause any compilation problems.

To eliminate problems that could be caused by IDE a good test is to compile with SBT. Shutdown running sbt, start it over again and run ;clean; compile; test in SBT console. If everything compiles fine (or even if it does not) regenerate your IntelliJ projects with gen-idea from SBT console. For all SBT commands in your case you should be in root project which I suppose is default location when you start SBT.

Related Query

More Query from same tag