4.5 Versioning - Reference Documentation
Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith, Lari Hotari
Version: 2.3.8
4.5 Versioning
Versioning Basics
Grails has built in support for application versioning. The version of the application is set to0.1
when you first create an application with the create-app command. The version is stored in the application meta data file application.properties
in the root of the project.To change the version of your application you can edit the file manually, or run the set-version command:grails set-version 0.2
Detecting Versions at Runtime
You can detect the application version using Grails' support for application metadata using the GrailsApplication class. For example within controllers there is an implicit grailsApplication variable that can be used:def version = grailsApplication.metadata['app.version']
def grailsVersion = grailsApplication.metadata['app.grails.version']
GrailsUtil
class:import grails.util.GrailsUtil
…
def grailsVersion = GrailsUtil.grailsVersion