secondbreakfast
secondbreakfast

Reputation: 4384

IntelliJ support for renamed application.properties

I have a multi-module Spring Boot application where I have more than one module containing an applications.properties file. I understand that I can only have one file with the name application.properties so I have renamed one of them and then explicitly include it via @PropertySource("classpath:custom-name.properties"). This works fine, but by doing this I lose the IntelliJ property file support for this file (autocomplete, jump to source, etc). The icon for the file changes as well and no longer has the spring symbol on it. How can I make IntelliJ support renamed application.properties?

Upvotes: 2

Views: 990

Answers (1)

user723934
user723934

Reputation:

You can define custom name for Spring Boot configuration files by opening Spring facet in corresponding module(s), select Spring Boot autodetected fileset and then click "Customize Spring Boot" icon from toolbar. Then set textfield "spring.config.name" to "custom-name", all matching configuration files will be shown in tree below.

Upvotes: 3

Related Questions