Play Framework 2.3.4 routes redirection to subproject

Cipher Hat

quite new with Play framework, but I tried to setup subproject for my main project but when I tried to redirect the route from the main project to subproject, it couldnt recognise the subproject variable. I have followed based on the documentation here PlaySubProject

My main project structure is as illustrated below:

Main
   app
   conf
      application.conf
      routes
   modules
      sub
         app
         conf
            sub.routes
         build.sbt
   logs
   project
   public
   target
   test
   activator
   activator-launch-1.2.10.jar
   build.sbt

This is my main build.sbt file:

name := """Main"""

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayJava).aggregate(sub).dependsOn(sub)

lazy val sub = (project in file("modules/sub")).enablePlugins(PlayJava)

scalaVersion := "2.11.1"

libraryDependencies ++= Seq(
  javaJdbc,
  javaEbean,
  cache,
  javaWs
)

and my subproject build.sbt is as follows:

name := """Subproject"""

version := "1.0-SNAPSHOT"

scalaVersion := "2.11.1"

libraryDependencies ++= Seq(
  javaJdbc,
  javaEbean,
  cache,
  javaWs
)

Finally, this is my main routes file.

# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~

# Home page
GET        /                    controllers.Application.index()

# Map static resources from the /public folder to the /assets URL path
GET        /assets/*file        controllers.Assets.at(path="/public", file)

# SUB's
->  /sub    sub.Routes

The problem is in this routes file, it cannot even recognize sub variable on the last line at sub.Routes. How to solve this problem?

Josh Padnick

I'm not sure about your specific issue, but I setup a fully working and reasonably well-documented multi-project example at https://github.com/josh-padnick/play-multiproject-template. This is based on Play 2.2.3 (not 2.3.x), but it should be pretty close to what you need.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Play Framework 2.3.4 routes redirection to subproject

From Dev

Long dynamic routes in play framework 2

From Dev

How to "rewrite" urls or routes with Play Framework 2

From Dev

Redirection in Rails 4 routes

From Dev

Play Framework 2.5 subproject port configuration

From Dev

Play framework routes

From Dev

Play framework 2 : How to pass object between routes, views, and controller?

From Dev

play framework - bind enum in routes

From Dev

Play Framework, REST, Routes, and Controllers

From Dev

Scala backticks in Play Framework Routes

From Dev

Domain routes in Play Framework 2.3

From Dev

Play Framework Error in Routes file

From Dev

Play 2.3 subproject dependsOn

From Dev

Play 2.2 Filter in Subproject

From Dev

Non-capturing wildcards in Play Framework routes

From Dev

Using POST routes parameters in Play Framework

From Dev

Iterating all Play Framework routes in Test

From Dev

split routes in multiple files for play framework 2.2

From Dev

Play Framework @routes.Assets.at Compilation Error

From Dev

Play framework - call controller in routes with Class parameter

From Dev

Play framework routes, and scala predef values

From Dev

Non-capturing wildcards in Play Framework routes

From Dev

Using POST routes parameters in Play Framework

From Dev

Play framework - call controller in routes with Class parameter

From Dev

Objectify with Play Framework 2

From Dev

Play! 2.2 Subproject Split Routing

From Dev

Ebean enhancement in subproject Play 2.4

From Dev

Play! 2.2 Subproject Split Routing

From Dev

Play subproject won't run