I am new to spring and trying to use Spring Initilizr for my project.
I am using the code that was generated by this tool after adding dependencies for ‘Spring Web’ and ‘Spring Data Redis’.
When I open the generated code in IntelliJ and try to edit the file application.properties, I notice that everything I type there is grayed out. According to IntelliJ it is an ‘unused property’.
Any idea how to enable application.properties in my project?
2
Answers
As it was mentioned in one of the comments, it is indeed an issue with InteliJ. The properties are working as expected, IntelliJ for some reason doesn't display it correctly.
I see that the answer is accepted; but do not see the solution provided explicitly. In the event it helps others, the property file will be read even if it is greyed out or says "unused property". But if you want the color coded keys, this is what I did to make Intellij recognize the application properties file.
Option-1) Recomplile application.properties under
Build -> Recomplile 'application.properties'
https://i.stack.imgur.com/I6MXc.pngOption-2) Invalidate cache under
File -> Invalidate Caches
with IDE restartRebuild the project with either of these options and see if the file is recognized.