Spring Boot Profile Profile Properties
I am using Sprint Boot and want to have multiple profile specific properties files. Status of documents:
In addition to application.properties files, specific property profiles can also be defined using the APPLICATION- {profile} .properties naming convention.
However, I have multiple properties files (for example db.properties
). I am currently downloading this non-core file as:
@Configuration
@PropertySource( {"classpath:db.properties"} )
class DataSourceConfig {
@Value("db.server") String server;
...
}
How can I combine these two things together, so it loads db-dev.properties
like Spring Boot forapplication.properties
It looks like it should be easy, but I can't figure out how to do it?
+3
source to share