How to change Gradle version in Eclipse using Buildship?

I am running Eclipse Luna SR2 with Buildship 1.0.1.

The Gradle projects that I create using the wizard are built using Gradle 2.5-rc-2, but I would like to use 2.6, which is the latest version.

How can i do this?

The task setup had no effect:

apply plugin: 'java' repositories { jcenter() } dependencies { testCompile 'junit:junit:4.12' } task wrapper(type: Wrapper) { gradleVersion = '2.6' } 

Solution: For some reason, it only works if I restart Eclipse after installing the version, as Makoto suggested.

+5
source share
3 answers

If you want to use a wrapper, just set the gradleVersion property:

 task wrapper(type: Wrapper) { gradleVersion = '2.6' } 
+6
source

You can create a new Run Configuration of the Gradle Project type that performs the wrapper task. Running this launch configuration should update the wrapper version without having to restart eclipse.

0
source

I had the same problem with different versions. The solution is to add the following task to the build file and then run the gradle shell task in the project root folder:

 task wrapper(type: Wrapper) { gradleVersion = '2.6' } 

The reason the wrong version of the shell was used for assembly is because there was no shell for the version I wanted to use.

0
source

All Articles