I have a PlayFramework application, and there is a name
and version
in the build.sbt
.
If I run the play console, I can access this information by typing name
or version
.
How can I get this information from Java code inside the application? I can't seem to find any useful methods in Play.application()
and I have not been able to find this in the documentation.
For this you can use the SBT plugin BuildInfo:
Add to project/plugins.sbt:
And to build.sbt:
Now you can access the build information with static methods: