How to import the abc class from the main project, which will be used by another class in the web project in the multi-project sbt ?
On sbt compile I get:
object abc is not a member of package com not found: type abc
Although compiling from IntelliJ is successful.
build.sbt
lazy val main = project.in(file("main")) .settings(commonSettings: _*) lazy val web = project.in(file("web")) .settings(commonSettings: _*) .enablePlugins(PlayScala) .dependsOn(main) lazy val root = (project in file(".")) .dependsOn(web, main) .aggregate(web, main) .settings(commonSettings: _*) mainClass in root in Compile := (mainClass in web in Compile).value fullClasspath in web in Runtime ++= (fullClasspath in main in Runtime).value fullClasspath in root in Runtime ++= (fullClasspath in web in Runtime).value
Inside the web project :
package com.company.web.controllers import _root_.com.company.main.abc
Inside the main project :
package com.company.main class abc @Inject() (){
What could be wrong? Thanks.
source share