Using application.properties/{env}.yml file from different repository in Spring batch

143 Views Asked by At

I am looking for a approch for my batch application where I need to store my application in project.git and environment related properties in project-config.git And during deployment my environment specific properties will be used

Application will have local application.properties which will be used locally and one main application.propeties from which we can use {env}.yml(lower env and production env) for env specific properties

1

There are 1 best solutions below

0
On

There are couple of ways to achieve this.

  1. Git Clone in the target runtime
  • Git clone the project-config.git in your target runtime e.g., /home/appuser/project-config
  • Download and run your actual jar file java -jar /home/appuser/project.jar --spring.config.location=/home/appuser/project-config/dev.properties
  1. Maven Packaging (Parent & Child Projects)
  • project-config.git (Parent Project) mvn.xml (Add module dependency of project.git's artifact) Package the project-config.git and run the jar with spring.config.location=classpath:/src/dev.properties as CLI argument