spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.35k stars 40.72k forks source link

Support DevTools override properties from custom starters #13332

Open mvitz opened 6 years ago

mvitz commented 6 years ago

A colleague of mine wrote a custom spring boot starter (https://github.com/faucet-pipeline/faucet-pipeline-spring-boot-starter). This starter contains a property faucet-pipeline.cache-manifest which by default is set to true.

However for development it's recommended setting this to false. This is described in the projects Readme but can easily be overseen. It forces any user of the starter to find a solution for setting this value to a different value in development as well.

It would be nice if the starter could provide something that will be picked up by DevTools and configure this automatically.

I'm sure that this is useful for many other starters as well.

philwebb commented 6 years ago

Probably the easiest option would be to change DevToolsPropertyDefaultsPostProcessor to look for properties files on the classpath named in a certain way. We could then move the hard-coded ones we have into an actual properties file.

snicoll commented 6 years ago

I was more thinking of a way to load an EnvironmentPostProcessor in a specific way. Right now, this post-processor kicks in because it simply is in the library but perhaps we should generalize that a bit.

mvitz commented 6 years ago

My first idea was providing a properties file to add some properties, too. But feel free (of course) to find a better solution that you are willing to support and maintain.