Play sbt subProjects routes: shopping.routes:5: object Application is not a member of package controllers.shopping

南笙酒味 提交于 2019-12-11 04:15:59

问题


Please give me some advice. I am following this: https://www.playframework.com/documentation/2.2.x/SBTSubProjects

What I am doing wrong? I have error with sub project routes:

shopping.routes:5: object Application is not a member of package controllers.shopping

My shopping.routes:

GET /index                  controllers.shopping.Application.index()
GET /assets/*file           controllers.shopping.Assets.at(path="/public", file)

My shopping.controllers.Application class:

package controllers.shopping

import play.api._
import play.api.mvc._
import views.html._

public Class Application extends Controller {

  public Result index() {
    return ok("shopping");
  }
}

my main build.sbt file:

import play.Project._
name := "svp"


version := "2.0.0_(20140725)"

libraryDependencies ++= Seq(
  javaJdbc, 
  javaJpa, 
  "org.hibernate" % "hibernate-entitymanager" % "3.6.9.Final",
  "mysql" % "mysql-connector-java" % "5.1.27",
  "org.mindrot" % "jbcrypt" % "0.3m",
  cache
  )

playJavaSettings

lazy val shopping = project.in(file("modules/shopping"))

lazy val main = project.in(file(".")).dependsOn(shopping).aggregate(shopping)

回答1:


I've missed one folder in structure: folder "app" so it should be: /modules/shopping/app/controllers/Application.java

but I had instead of it: /modules/shopping/controllers/Application.java

So I am closing :D



来源:https://stackoverflow.com/questions/25746065/play-sbt-subprojects-routes-shopping-routes5-object-application-is-not-a-memb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!