playframework 2.0, subproject and routes
Asked Answered
M

1

1

I have one PlayfFamework 2.x' (PF2) default scala project (htc-sample) and depended default PF2 scala project (htc) like was shown here:

http://www.playframework.org/documentation/2.0/SBTSubProjects

But I got one ERROR with routes when trying to launch the main project. Like this:

[info] Compiling 5 Scala sources and 1 Java source to ~/projects/sample-htc/modules/htc/target/scala-2.9.1/classes... [error] ~/projects/sample-htc/modules/htc/target/scala-2.9.1/src_managed/main/views/html/main.template.scala:23: not found: value routes [error] Any),format.raw/*8.94*/("""">

What is the procedure to work with subprojects regarding to routes?

--

I guess I found the answer: it is impossible to do.. in play v.2.0. Because of this statement:

"You may want to split a large project into several smaller applications, or even extract some logic into a standard Java or Scala library that has nothing to do with a Play application". But does it mean that the subproject could not be a play projects with routes file? it can depend on another Play application.

But there is another statement: "it can depend on another Play application."

Milissamilissent answered 16/11, 2012 at 21:23 Comment(0)
B
3

Currently there's a limitation on play framework 2 regarding routes and subprojects

Have a look at these threads

https://groups.google.com/forum/#!msg/play-framework/O-lI0PsxM0U/fwHWylZoPpoJ

https://groups.google.com/d/msg/play-framework/Tr8NhKaHmiw/0_kY1z3OfAAJ

It's already solved in play 2.1 trunk

Besse answered 16/11, 2012 at 21:57 Comment(4)
I suppose it is quite critical feature to have routes working fine (like it was in PF v 1.x in modules).Milissamilissent
is it ok to use 2.1 trunk now? your suggestion? if I'm just beginning the new project.Milissamilissent
they've just tagged play 2.1 as release candidate today, I suggest you ask at the google group, perhaps someone can point you to a proper workaround if you give more details about your particular requirement groups.google.com/forum/?fromgroups#!forum/play-frameworkBesse
Not sure this works, yet - even with 2.1-RC1 I create a submodule Play! application that has a routes file: GET /sub controllers.SubmoduleApplication.sub I then create the core Play! application, with its own routes file: GET /core controllers.Application.core When I run the core application, /sub gets picked up, but NOT /core.Mckeon

© 2022 - 2024 — McMap. All rights reserved.