tuplejump / play-yeoman

Play + Yeoman integration sbt and play plugins
Apache License 2.0
237 stars 58 forks source link

Play run works fine, but using start script generated by "stage" task returns empty screen #36

Closed jschaul closed 9 years ago

jschaul commented 10 years ago

Hi,

thanks for this plugin, with "play run", the workflows of play and grunt integrate nicely.

play run

followed by pointing a browser to localhost:9000/ui/ works as expected.

However, taking as an example the yo-demo app (I also tried with a freshly scaffolded "yo angular" app under folder /ui"), doing the following gives problems:

play clean compile stage
./target/universal/stage/bin/yo-demo

gives this output:

Play server process ID is 78065
[info] play - Application started (Prod)
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

But on localhost:9000/ui/ I get a blank screen. On firefox or Chrome I get a blank screen together with 404 not found:

GET http://127.0.0.1:9000/ui/ [HTTP/1.1 404 Not Found 4ms]

Note that normal scala template views show under their respective url, so localhost:9000/oldhome for example with yo-demo works fine.

Am I doing something wrong or is this a bug?

Thanks!

Additional information:

play 2.2.1 built with Scala 2.10.2 (running Java 1.7.0_10)
sbt.version=0.13.0
#in plugins.sbt:
addSbtPlugin("com.tuplejump" % "sbt-yeoman" % "0.6.3")
milliondreams commented 10 years ago

This mostly occurs when the grunt task fails. Currently play-yeoman doesn't fail the stage/dist if there is a error in grunt. So you will have to scroll up in the build output and check if grunt completed successfully.

jschaul commented 10 years ago

The grunt task when run from within ui completes successfully.

But compiling with scalacOptions += "-feature" in the Build.sbt file gives the following warning:

[info] Compiling 15 Scala sources and 3 Java sources to <project>/target/scala-2.10/classes...
[warn] <project>/conf/routes:28: reflective access of structural type member method unapply should be enabled
[warn] by making the implicit value scala.language.reflectiveCalls visible.
[warn] This can be achieved by adding the import clause 'import scala.language.reflectiveCalls'
[warn] or by setting the compiler option -language:reflectiveCalls.
[warn] See the Scala docs for value scala.language.reflectiveCalls for a discussion
[warn] why the feature should be explicitly enabled.
[warn] ->      /ui/        yeoman.Routes
[warn] <project>/conf/routes:28: reflective access of structural type member method unapply should be enabled
[warn] by making the implicit value scala.language.reflectiveCalls visible.
[warn] ->      /ui/        yeoman.Routes
[warn] two warnings found

and compiling with: scalacOptions += "-language:reflectiveCalls" added to the Build.sbt under Project settings results in the play stage task to successfully create target folders and files that work as they should. Hooray!

Are you perhaps using an older version of Scala, where this issue didn't occur? Perhaps adding import scala.language.reflectiveCalls in your plugin might solve this issue? otherwise perhaps you could include setting this Scalac flag in your readme file?

Thanks!

Shiti commented 9 years ago

related to #40