Thursday, 8 February 2018

How to use multiple properties file ?


Use any file and put it parallel to application.properties.

application.properties uses its values, but if there are some other file to be used, pass JVM argument : -Dspring.profiles.active={profile}

 -Dspring.profiles.active=dev

It will pick properties from application-dev.properties.


ORDER OF PICKING PROPERTIES
  • Profile specific application-{profile}.properties outside JAR
  • Profile specific application-{profile}.properties inside JAR
  • Profile specific application.properties outside JAR
  • Profile specific application.properties inside JAR

No comments:

Post a Comment

Note: only a member of this blog may post a comment.