To do this, you can use the SBT BuildInfo plugin :
Add to the project /plugins.sbt:
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.2.5")
And for build.sbt:
buildInfoSettings sourceGenerators in Compile <+= buildInfo buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion) buildInfoPackage := "hello"
Now you can access the assembly using static methods:
package controllers; import play.*; import play.mvc.*; import views.html.*; public class Application extends Controller { public static Result index() { return ok(hello.BuildInfo.name());
source share