I want to import classes in one project to the other project in scala multi-project.
Now My project structure:
Project
ᄂ project1
│ ᄂ src
│ ᄂ main
│ ᄂ scala
│ ᄂ com.foo1.bar
│ ᄂ aaa
│ ᄂ aaa1.scala
ᄂ project2
ᄂ src
ᄂ main
ᄂ scala
ᄂ com.foo2.bar
ᄂ bbb
ᄂ bbb1.scala
bbb1.scala :
class bbb1() {
def bFunction() = {
// some function
}
}
In this case, I want to import bbb1 in aaa1.scala file like below:
aaa1.scala
import com.foo2.bar.bbb._
class aaa1() {
def aFunction() = {
val t = bFunction()
}
}
I set the build.sbt dependsOn()
. But IDE highlight the import com.foo2.bar.bbb._
is wrong.
And If I run some test code, error raise.
I use IntelliJ and scala 2.12.12.