How can I use my own .properties file with spring-boot. I don't want to use the application.properties. I have to exclude some properties from there. Are there any annotations for that?
Asked
Active
Viewed 344 times
1
-
2If I am correctly understanding your question, you can use @PropertySource for custom properties file. – Harshit May 03 '18 at 13:58
-
See the [docs](https://docs.spring.io/spring-boot/docs/current/reference/html/howto-properties-and-configuration.html) for more information on `@PropertySource` – Jacob May 03 '18 at 14:06
-
thanks it helped me. – Dullimeister May 03 '18 at 14:10
2 Answers
1
using @PropertySource(ignoreResourceNotFound = true, value = "classpath:yourproperties.properties")
you can follow this stackoverflow thread https://stackoverflow.com/a/47178674/7538821

sam
- 1,800
- 1
- 25
- 47
0
@PropertySource("classpath:custom.properties")
on your class and i suggest the .yml file instead of properties which will give you more flexibility