[JAVA] Resolve "Cannot resolve symbol" in IntelliJ projects using Gradle

I have no Java power, so I am learning something that can't be helped every day.

Today's "Unreasonable Learning" is the case where I wrote the following in build.gradle, but IntelliJ solved ʻimport lombok.Data;` as "Cannot resolve symbol".

dependencies {
	compile 'org.projectlombok:lombok:1.16.10'
}

It's really ridiculous, but when I select "File" => "Invalidate Caches / Restart ..." and restart IntelliJ, IntelliJ restarts with the cache cleared. Furthermore, in my case, a window called "Import Module from Gradle" was launched, and I was able to solve the problem by checking "Use gradle wrapper task configuration" (a gradlew file is created).

I hesitate to write in Qiita because it's too ridiculous, but I have no choice but to accept the ridiculous level.

Recommended Posts

Resolve "Cannot resolve symbol" in IntelliJ projects using Gradle
Do HelloWorld in Java / IntelliJ / Gradle
Unable to get resources when using modules in Gradle and IntelliJ
Creating a project (and GitHub repository) using Java and Gradle in IntelliJ IDEA
Generate DB documentation using SchemaSpy in Gradle
[Gradle] Build operations often performed in Java projects
[Note] Struts2 environment construction using Gradle in Eclipse
Tips for generating files for eclipse projects in Gradle
Automatically generate DDL using [jpa-schema-gradle-plugin] plugin in Spring × Gradle