You can externalize your config files (check spring documentation).
In order to do so add the following dependency in your pom.xml:
Maven:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
then on your git server create a git repository and add the following into your application.properties:
spring.cloud.config.server.git.uri=http://{yourGitRepoUrl}.git
And add @EnableConfigServer annotation to your SpringBootApplication class.
and finally link your app to your config server by adding the following to application.properties:
spring.cloud.config.uri=http://localhost:8080 #whatever your port is
For more detail check this nice Tutorial.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…