Update Gradle in Grails project - grails

I am using Grails 3.0.5
After I create a project... at root project has folder .gradle with 2.3 version...
How to update that Gradle version?
I tried to download Grails 3.0.9 and create a new project..but it still use Gradle 2.3 version..
I tried to download Gradle 2.6 from this link , because I am using windows... I tried to run gradlew.bat ... and recreate-app with Grails 3.0.9 version...and i still get a new project with Gradle 2.3

That's defined in gradle.properties. If you change the version there (I recommend using 2.8 for the new features and speed improvements) you can use the wrapper that's there from Gradle 2.3 to generate a new wrapper for whatever version you're updating to; just run
gradlew.bat wrapper
or
./gradlew wrapper
if you were using Linux or OSX, and it will update the gradlew and gradlew.bat scripts, and the wrapper files under gradle/wrapper.

Related

Intellij 14 Grails Project Error on run-app: Module not backed by Gradle

I recently downloaded a new Intellij version 2017 for Grails 3 upgrade .I am using Intellij 14 with Grails 2.3.7.When I was prompted to import settings for new version,I clicked yes .Now however when I try to run my existing 2.3.7 project in Intellij 14 ,it complains Module not backed by gradle. I did not use gradle in my 2.3.7 Project.How to run this app.
Apparently my project.iml file was messed up.I had to clean that up and was able run in previous version.Thanks All
you can use the ./gradlew command with gradle installed in your machine to rebuild your gradle project.

After import of an existing project, the gradle version is less then when creating a Gradle project

When I create a new Gradle project, the Gradle version is 3.3. But when I import an existing Gradle project, the Gradle version is 2.4.11. How are the version determined, especially the last one, because as far as I can see, there is no Gradle version information in the existing Gradle project.
I don't know am I understand your issue correctly or not. But as I understood:
The version of gradle is determined in your build.gradle file.
There is a line there like below:
classpath 'com.android.tools.build:gradle: 2.2.2'
which 2.2.2 is the version.
the highest stable version till now is 2.2.3 (which it is not suitable for me) .
Note that versions above 2.2 need jdk 8 (not work with jdk 7)
I found out that you have to look at the file gradle/wrapper/gradle-wrapper.properties. The last line of this file gives the Gradle version:
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
Before importing an existing Gradle project, maybe you want to edit this line.

Is there a script to upgrade Grails 3.1.x apps to latest 3.1 version?

Is there a recommended process, script, or reference for upgrading Grails 3.1 apps to the latest maintenance release version?
Currently upgrading from 3.1.3 to 3.1.8 and there are some dependency updates (e.g. asset-pipeline) that are not mentioned in the release notes (https://github.com/grails/grails-core/releases). I only found them by comparing configs from a sample create-app run.
This process has worked for me:
First, download the new grails to your machine. I usually download the tar.gz to /usr/local, gunzip, tar xvf, to /usr/local/grails-3.1.8 or whatever.
Second, add this to your .bash_profile:
GRAILS_HOME=/usr/local/grails-3.1.8
export GRAILS_HOME=$GRAILS_HOME
PATH=$PATH:$GRAILS_HOME/bin
export PATH=$PATH
Third:
source .bash_profile
Fourth, go to your projects directory, and:
grails create-app test-3.1.8
cd test-3.1.8
nano build.gradle
Here, you will see the new dependency version numbers that are required
for your new version, in this case 3.1.8. (As I write, 3.1.9 is out.)
Now, go back to your old project's build.gradle and update the
dependency version numbers to match.
Stumbled across this handy repo to automate the app comparison process https://github.com/erichelgeson/grails-versions

Changes in inplace plugin code in grails3.x are not reloading automatically

I am upgrading a project from Grails 2.5.1 to Grails 3.1.4.
My Multi-Project Build structure in Grails 3.1.4 is as follows:
- Root
|--MainProject
|--Plugin1ForMain
|--Plugin2ForMain
|--settings.gradle
I run the MainProject using grails run-app command and whenever I change my codes in Plugin1ForMain or any other plugins, the changes are not automatically recompiled like it did in Grails2.x .
How can I make my project autocompile plugin's code in grails3.x ? I am using gradle version 2.3
I also got the same issue with grails 3.1.4 and when I changed the version of Gradle and profile web plugin it started working for me. Hope it solves your problem too.
a) Use Gradle version 2.13, change the Gradle version in gradle.properties
gradleWrapperVersion=2.13
b) And change the profile plugin version to 3.1.6 in build.gradle
profile "org.grails.profiles:web-plugin:3.1.6"

How to integrate grails 3.0.5 project in GGTS 3.6.4

I am using grails-3.0.5 cause of i want to use groovy 2.4.4.
I created project by command
>grails create-app Student
>grails clean
Fine its working and created project.
But when i executed below command then command is there.
>grails integrate-with --eclipse
Can anyone help me how to integrate with eclipse.
I don't use eclipse and don't know what kind of integration do you mean, but grails 3 is using gradle as a build tool and eclipse plugin is added automatically to the build.gradle file. You can execute ./gradlew eclipse (or on windows gradlew.bat eclipse) to generate all eclipse related files.
To clean eclipse files you can use: ./gradlew cleanEclipse.

Resources