[Play 2.3 Java] Unable to load assets from sub-projects/modules with dist

51 views
Skip to first unread message

Patrick Li

unread,
Jul 23, 2015, 3:40:28 AM7/23/15
to play-framework
Hi,

I have a project with several sub-modules, something like below (which I think is quite standard):

app
  └ views
    └> index.scala.html
  └ public
    └ stylesheets
      └> main.less
conf
  └> application.conf
  └> routes
modules
  └ web
    └ app
       └ appspokes.web
           └ controllers
              └> Assets.java
    └ public
      └ javascripts
        └> web.js
      └ stylesheets
        └> web.css
    └ conf
        └> web.routes

In the main app's routes file, it is like the following:
... ...
GET         /assets/*file                            controllers.Assets.at(path="/public", file)
GET         /webjars/*file                           controllers.WebJarAssets.at(file)
... ...

In the web sub-module, the web.routes file is like the following:
... ...
GET        /assets/*file        appspokes.web.controllers.Assets.at(path="/public", file)
... ...

Now, everything works fine in dev mode (i.e. run from within IntelliJ), but when I try to run the app from a zip produced with dist, I am unable to load the javascripts and css files from the web-submodule. For example, the URL http://localhost:9000/web/assets/javascripts/web.js would give a 404.

Any idea why the assets will load fine in dev mode but not in dist mode?

Thanks

Byron Weber Becker

unread,
Nov 7, 2015, 9:18:15 PM11/7/15
to play-framework
Did you find a solution to this?  I have a similar problem with Play 2.3.8 (Scala).  It's a project
with sub-projects, like yours.  "activator dist" used to work for this project.  However, I just updated
a javascript file and now it's not being included in the distribution.

I installed a new version of activator since the last successful distribution; wondering if that has
something to do with it.

Thanks,
Byron
Reply all
Reply to author
Forward
0 new messages