how to find your project current versions in grails
Asked Answered
A

8

10

I want to know the versions of the software used while developing the project, Suppose If there is an existing project In grails ,so I want to know the version of grails as well as version of Groovy for that project

Asaph answered 30/5, 2014 at 11:29 Comment(1)
To get the Groovy version anywhere in the app, you can use GroovySystem.getVersion() or just GroovySystem.versionPalaeozoology
S
6

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.grails.version.

The version of Groovy used however is not kept in this file and is determined by the version of Grails being used. To determine the version of Groovy used by a specific version of Grails visit the introduction section of the Grails documentation.

edit

As pointed out in another answer, if you have target version of Grails already downloaded you can search for the version of Groovy being used by that version of Grails.

*nix

$ cd grails-X.X.X 
$ find . -name "groovy*jar"

win32

> cd grails-x.x.x
> dir /s "groovy*.jar"
Sorghum answered 30/5, 2014 at 11:35 Comment(0)
A
5

If you already have a project and want to learn which grails version it uses. You can find it in gradle.properties file. The content of the file is like the following

grailsVersion=4.0.1
gorm.version=7.0.2.RELEASE
Antler answered 5/9, 2020 at 22:56 Comment(0)
V
3

From controllers/services:

def appVersion=Metadata.current.'app.grails.version'
def appName=Metadata.current.'app.name'

From gsp:

App Version <g:meta name="app.version"/> 
Built with Grails <g:meta name="app.grails.version"/> 

Added extra information to figure out a grails application version from raw text files :

If you have a grails 3 application, you should find a build.gradle in the main root of your application folder:

version "0.1" According to this grails 3 project the version of this application is 0.1

Grails version is 3.1.1 according to gradle.properties

On a grails 2 project you will find application.properties in the main project root:

According to this grails 2 project

grails version is 2.4.4 App version is 0.1

Violetavioletta answered 30/5, 2014 at 11:42 Comment(4)
I get the error No such property: Metadata for class for appVersionKarrikarrie
the above was for grails 2 are you using it on grails 3 ? grails.github.io/grails-doc/3.0.x/ref/Tags/meta.htmlVioletavioletta
if i knew which version of grails i used then i would not look at this question. The link you gave only shows printing for GSP not for controllers.Karrikarrie
@Karrikarrie take a look at my updated answer, its how you manually can find all that outVioletavioletta
M
1

As of Grails 3, this is:

Version <g:meta name="info.app.version"/>

Notice the info. http://docs.grails.org/3.0.17/ref/Tags/meta.html

Mitzimitzie answered 6/9, 2016 at 11:57 Comment(0)
N
0

use application.properties in the root of the grails application

Nels answered 30/5, 2014 at 11:30 Comment(0)
D
0

To find out which version of groovy is used with particular version of grails I always use simple find:

$ cd grails-X.X.X 
$ find . -name "groovy*jar"

Maybe I'm just too lazy to dig into websites... ;-)

Decerebrate answered 30/5, 2014 at 12:11 Comment(1)
Assuming 1. You are running *nix and 2. You have the version of Grails downloaded.Sorghum
D
0

You can see application name,grails version,application version from application.properties file of grails project

Deedee answered 31/5, 2014 at 5:11 Comment(0)
M
-2

I face the same issue, I found simplest way to find version by simple command. run

grails clean

then it prints
Welcome to Grails 1.3.7 - http://grails.org/

Melt answered 18/6, 2018 at 11:46 Comment(1)
This is the version of Grails currently in use on the command line, not the version required by a project.Blather

© 2022 - 2024 — McMap. All rights reserved.