Make some changes in the build.gradle file, but the changes never apply or sync to the IDEA (Tested with 2016.3)

1. Using IDEA plugin

build.gradle

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'

2. Make changes and issue the Gradle clean and idea command.

Console

$ gracle clean idea
$ gradle cleanIdea idea
$ gradle cleanIdeaWorkspace idea

All the above Gradle commands do not sync the changes to IDEA.

Note
To fix it, we need to re-import the project as Gradle project, but this is rarely the solution.

Solution

To sync Gradle project changes to IDEA, you need to click on the Gradle Tool Windows “Refresh” button.

To access Gradle Tool Window, in IDEA menu, clicks View -->> Tool Windows -->> Gradle

Gradle Tool Windows

Clicks on the “Refresh all Gradle projects” button. Done.

References

  1. Gradle Tool Window