I am using play 2.3.8 and using this gudie to create sub project in my project i created subproject 'mySubProject' and then i imported the project in eclipse the parent project myParentProject
and mySubProject
now i have two questions
first -> is this correct that first i imported myParentProject
in eclipse then i imported mySubProject
Second-> in my mySubProject
i can access the classes of myParentProject
and import its packages
but in mySubProject
when i want to access the class/packages of my myParentProject
its does not let me do that it show error Object not found
here is the build file of root project myParentProject
name := """myParentProject"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
.aggregate(mySubProject)
.dependsOn(mySubProject)
scalaVersion := "2.11.1"
fork in run := true
javaOptions in run ++= Seq("-J-Xms1G", "-J-Xmx2G")
val appDependencies = Seq(
// Add your project dependencies here,
"org.scalatestplus" %% "play" % "1.2.0" % "test"
)
lazy val mySubProject = project
libraryDependencies ++= Seq("org.scalatest" %% "scalatest" % "2.2.1" % "test"withSources() withJavadoc(),
"com.esotericsoftware.kryo" % "kryo" % "2.10",
"org.mongodb" %% "casbah" % "2.8.0",
"org.slf4j" % "slf4j-api" % "1.6.4",
"org.elasticsearch" % "elasticsearch" % "1.6.0",
"org.codehaus.groovy" % "groovy-all" % "2.4.0",
"org.apache.lucene" % "lucene-expressions" % "4.10.4",
"org.scalatest" %% "scalatest" % "2.2.1" % "test"withSources() withJavadoc(),
"org.easymock" % "easymock" % "3.1" withSources() withJavadoc(),
"org.mockito" % "mockito-all" % "1.9.5",
"com.typesafe.akka" %% "akka-actor" % "2.3.6",
"ch.qos.logback" % "logback-core" % "1.0.9",
"com.github.nscala-time" %% "nscala-time" % "2.0.0",
"net.liftweb" %% "lift-json" % "2.6+",
"net.liftweb" %% "lift-json" % "2.6+",
"com.hazelcast" % "hazelcast" % "3.5",
"com.hazelcast" % "hazelcast-client" % "3.5",
"com.twitter" % "chill-bijection_2.11" % "0.7.0"
//,"com.codahale" % "jerkson_2.9.1" % "0.5.0"
)
and here is build file of child projectmySubProject
name := """mySubProject"""
version := "1.0-SNAPSHOT"
scalaVersion := "2.11.1"
libraryDependencies ++= Seq("org.scalatest" %% "scalatest" % "2.2.1" % "test"withSources() withJavadoc(),
"org.slf4j" % "slf4j-api" % "1.6.4",
"org.elasticsearch" % "elasticsearch" % "1.6.0",
"org.codehaus.groovy" % "groovy-all" % "2.4.0",
"org.apache.lucene" % "lucene-expressions" % "4.10.4",
"org.easymock" % "easymock" % "3.1" withSources() withJavadoc(),
"org.mockito" % "mockito-all" % "1.9.5",
"com.typesafe.akka" %% "akka-actor" % "2.3.6",
"ch.qos.logback" % "logback-core" % "1.0.9",
"com.github.nscala-time" %% "nscala-time" % "2.0.0",
"net.liftweb" %% "lift-json" % "2.6+",
"net.liftweb" %% "lift-json" % "2.6+")
and here is the code
in my parent project myParentProject
i created a class named app/myPackagae/abc.scala here is the code
package myPackagae
import mySubProject._
class abc {
def helloAbc()={
println(" i am root project and i am class abc ")
}
val test=new Testing
test.helloTesting()
}
and in mySubProject
i created a class in /mySubProject/src/main/scala-2.11/mySubProject/Testing.scala
here is the code
package mySubProject
//import parentProjectPackage._
import myPackagae._ //here is an error not found: object myPackagae
class Testing {
def helloTesting() ={
println("i am a subproject or child project and i am class Testing")
}
//and here i want to access class abc and its method helloAbc() but eclipse is not importing
}
please guide me how can i import packages/classes of root project in child project