简体   繁体   中英

IntelliJ IDEA Ultimate Edition marks all my Spring Boot properties as unused

IntelliJ IDEA Ultimate Edition marks all my Spring Boot properties as unused.

  1. 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.

  2. The problem is not that the folder would be not marked as Resources (see the screenshot).

  3. The problem is not that Idea would not recognize the file as the properties file (see the screenshot).

  4. Idea can even show correct tooltips for the properties (see the screenshot).

  5. All the properties are used, if I remove any of them, my application stops working:)

  6. For the record: I do not want to suppress the warnings.

  7. Yes, I invalidated the cache.

  8. 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

Have you installed Spring Initializr and Assistant plugin? I had this problem after install it. You can try to disable it.

Have you tried invalidate cache? Maybe that could help you make it run. There are multiple options in invalidate cache, choose according to your use case.

File > Invalidate Cache

It is confirmed that the Spring Initializr and Assistant plugin was the culprit:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM