Eclipse Buildship plugin doesn't use the gradle wrapper

I have a gradle project in Eclipse that was first configured not to use the gradle wrapper. So, in the command line, I run:

gradle wrapper

to generate the required wrapper files. And the files were generated:

img1

I thought that just doing this when I used the Gradle Tasks view to run tasks the gradle wrapper would be used, but I was wrong. For example, the below image shows the output when I run the build task.

img2

As you can see, it says:

Gradle Distribution: Local instalation at C:\gradle-6.6.1

clearly showing that the wrapper wasn’t used, but the local distribution in my machine instead.

If the wrapper was being used I think I would see something like this:

Gradle Distribution: Gradle wrapper from target build

So, how do I configure my Eclipse project to use the wrapper when running tasks in the IDE?

Right click on the project => Properties => Gradle. Is it set to use the wrapper (either directly or by inheriting from the workspace settings)?

Yes, it is. I also checked this before.

I was able to solve the problem doing this:

  1. Deleted the project from Eclipse
  2. Added the gradle wrapper manually from the command line (gradle wrapper)
  3. Imported the project in Eclipse configured to use the gradle wrapper

After those steps Buildship was still using the gradle local installation. So, I did this: repeated steps 1 and 2 above again, but before doing step 3, I manually deleted everything from the Eclipse workspace folder that was still referencing the deleted project.

So, when I did step 3 again, it worked: Buildship started using the gradle wrapper.

Sad that I had to delete a lot of junk that was still referencing the old project to make this work. Eclipse should have done this automatically when I deleted the project.

Old post, but I just had the opposite problem: always Gradle wrapper was still used although I had changed the project properties (project context menu → Properties → Gradle) to use a specific Gradle version and not the wrapper.
I think all you need to do is to delete the existing Gradle Run Configurations for that project (Run → Run Configurations → Gradle Task) (and maybe one should also do “project context menu → Gradle → Refresh Gradle Project”, which is nowadays enough to refresh the Gradle Task view). Then just restart the task from the Gradle Task view and the project specific settings should be used.