Yanick Rochon
Yanick Rochon

Reputation: 53576

error: package play.mvc does not exist

I am starting a test project with Play 2.1.2 and I want to try a modular approach. I have created a sub project and I have created some classes in it. I'm using eclipse, and I have successfully opened the project and sub-project in my workspace. Everything seemed to be fine. Until I fired up the terminal and tried to run it. It resolved all dependencies from Build.scala then spouted quite a few errors, from which the first was :

error: package play.mvc does not exist

from one class file in the sub project that seems fine from eclipse.

Since I don't know what information is required to help anyone fine the answer to this, I'll be updating this question with the required information. Meanwhile, if any kind soul would already spot the problem from this simple question, I'll be much grateful to know why I'm having this.

Thanks!

** Update **

Here is the build.scala file

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName         = "testapp"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    javaCore,
    javaJdbc,
    javaEbean,

    // Postgre SQL 9.1
    "postgresql" % "postgresql" % "9.1-901.jdbc4",

    // Deadbolt 2    
    "be.objectify" %% "deadbolt-java" % "2.1-RC2",
    "be.objectify" %% "deadbolt-scala" % "2.1-RC2"
  )

  val testappSubProject = Project(
    appName + "-subtest", file("modules/sub-project")
  ).settings(
    scalaVersion := "2.10.0"
  )

  val main = play.Project(
    appName, appVersion, appDependencies
  ).dependsOn(testappSubProject).settings(
    // Add your own project settings here

    resolvers += Resolver.url("Objectify Play Repository", url("http://schaloner.github.com/releases/"))(Resolver.ivyStylePatterns),
    resolvers += Resolver.url("Objectify Play Snapshot Repository", url("http://schaloner.github.com/snapshots/"))(Resolver.ivyStylePatterns) 
  )

}

Upvotes: 0

Views: 1423

Answers (1)

Julien Tournay
Julien Tournay

Reputation: 544

testappSubProject does not depend on Play, so if you try to import play.mvc in this project, it will fails.

Upvotes: 1

Related Questions