Reputation: 2477
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?
Upvotes: 16
Views: 11685
Reputation: 5621
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']
Upvotes: 24
Reputation: 5687
You can also use: ApplicationHolder.application.metadata['app.version']
Upvotes: 5
Reputation: 75671
Use <g:meta>
: http://grails.org/doc/latest/ref/Tags/meta.html
Upvotes: 21