Automatically inject WebJarAssets in Play 2.5 HTML template?
<p>In my Play HTML template inside my <code>custom</code> module, I have the following line of code:</p>

<pre><code>&lt;script type="text/javascript" src="@controllers.core.routes.WebJarAssets.at(WebJarAssets.locate("jquery.min.js"))"&gt;&lt;/script&gt;
</code></pre>

<p>This references a <code>WebJarAssets</code> class in the <code>core</code> module that looks like this:</p>

<pre><code>package controllers.core

import javax.inject._
import play.api.http.HttpErrorHandler
import play.api.{Environment, Configuration}

class WebJarAssets @Inject()(errorHandler: HttpErrorHandler, configuration: Configuration, environment: Environment) extends controllers.WebJarAssets(errorHandler, configuration, environment)
</code></pre>

<p>Please note that I have also included the following line in <code>build.sbt</code> in the <code>custom</code> module:</p>

<pre><code>"org.webjars" %% "webjars-play" % "2.5.0",
</code></pre>

<p>When starting the application, I receive the following error:</p>

<pre><code>[error] /Users/john/DemoProject/modules/custom/app/views/custom/templates/main.scala.html:36: not found: value WebJarAssets
[error]     &lt;script type="text/javascript" src="@controllers.core.routes.WebJarAssets.at(WebJarAssets.locate("jquery.min.js"))"&gt;&lt;/script&gt;
[error]                                                                                  ^
</code></pre>

<p>Judging from the implementation of WebJarAssets in earlier releases, there was no need to implement and inject an own controller for this (for example, see this <a href="http://www.ibm.com/developerworks/library/wa-playful-web-dev-1-trs-bluemix/" rel="noreferrer">tutorial</a>).</p>

<p>What am I doing wrong? Do I even need a <code>WebJarAssets</code> class for this (as I need web jar assets in many modules, I added this for now in the <code>core</code> module). Furthermore, why do I need to manually inject it in the template and why is it not automatically resolved?</p>

<p>In case you wonder what manually inject means for me:</p>

<pre><code>@(title: String, webJarAssets: WebJarAssets)(content: Html)(implicit messages:Messages)
&lt;script type="text/javascript" src="@controllers.core.routes.WebJarAssets.at(webJarAssets.locate("jquery.min.js"))"&gt;&lt;/script&gt;
</code></pre>