Issue
IntelliJ IDEA Ultimate Edition marks all my Spring Boot properties as unused.
I am aware of Unused properties in IntelliJ, but it does not help. The problem in that question was that the OP had Community Edition.
The problem is not that the folder would be not marked as Resources (see the screenshot).
The problem is not that Idea would not recognize the file as the properties file (see the screenshot).
Idea can even show correct tooltips for the properties (see the screenshot).
All the properties are used, if I remove any of them, my application stops working :)
For the record: I do not want to suppress the warnings.
Yes, I invalidated the cache.
Yes, I did reimport the project to Idea, yes, I did run
mvn idea:idea
.
Versions
IntelliJ IDEA 2021.3.3 (Ultimate Edition)
Build #IU-213.7172.25, built on March 15, 2022
Runtime version: 11.0.14.1+1-b1751.46 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
Non-Bundled Plugins:
com.intellij.ideolog (203.0.27.0)
String Manipulation (9.4.0)
dev.eltonsandre.intellij.spring.assistant.plugin (1.3.4)
com.intellij.lang.jsgraphql (3.1.2)
com.intellij.bigdatatools (213.5449.349)
com.haulmont.jpab (2022.1.2-213)
Kotlin: 213-1.5.10-release-949-IJ7172.25
Solution
It is confirmed that the Spring Initializr and Assistant plugin was the culprit:
- I had created a bug report https://github.com/eltonsandre/intellij-spring-boot-assistant/issues/77,
- which showed as a duplicate of already existing bug report https://github.com/eltonsandre/intellij-spring-assistant/issues/71,
- which is now closed, fixed in version 1.4.0.
Credits: Thanks to @DiegoMN's tip.
According to the author, it should be fixed now, however now no properties are marked as unused. It is under investigation.
Elton André commented on 01 Apr 2022:
For now, the functionality that scans and verifies the usage of Spring properties is not fully implemented. For now, in this release, it will suppress all Spring settings (application*.properties and bootstrap*.properties files), to give a little more comfort to the eyes, and that there aren't too many unused warnings. As soon as possible, I will be happy to make the full version available with the appropriate alerts for unused and deprecated properties.
Answered By - Honza Zidek
Answer Checked By - David Marino (JavaFixing Volunteer)