Getting grails application version from within the app

Viewed 11336

I'd like to display the application version in the footer of my app. Is there a way to get the value of the app.version variable in the application.properties file at runtime?

3 Answers

ApplicationHolder is depreciated.

You can use

Holders.grailsApplication.metadata['app.version']

or inject grailsApplication bean by adding field:

def grailsApplication

and access to application version

grailsApplication.metadata['app.version']
Related