Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting grails application version from within the app

Tags:

grails

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?

like image 985
speshak Avatar asked Jul 27 '10 22:07

speshak


People also ask

How do I check my project grails version?

Metadata regarding a project in Grails is kept in application. properties . Within this file you will find the version of Grails used for the project under the key app.


1 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']
like image 198
Michal Z m u d a Avatar answered Oct 14 '22 21:10

Michal Z m u d a