1

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?

Dullimeister
  • 504
  • 1
  • 7
  • 18

2 Answers2

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