Issue
I have a requirement where I am deploying a jar with its application.properties file outside of it. Is there any way that when I change an property in application.properties the jar automatically detects the changes and restarts/redeploys itself?
Solution
@RefreshScope annotation is provided in spring-boot. By use of this annotation, you can reload a property value(use inside your code) from .properties.
here is the link for reference :http://projects.spring.io/spring-cloud/spring-cloud.html (Search @RefreshScope).
The idea is to reload whole bean(which is annotated with @RefreshScope),after hitting /refresh end point & you do not need to restart webapp again.
Answered By - Ashay Patil
Answer Checked By - Willingham (JavaFixing Volunteer)