skip to Main Content

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


  1. Chosen as BEST ANSWER

    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.


  2. 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.png

    Option-2) Invalidate cache under File -> Invalidate Caches with IDE restart

    Rebuild the project with either of these options and see if the file is recognized.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search