Saturday, May 22, 2021

Passing parameters into springboot application

  • User OS env variable
  • Use java -Dk1=v1 -Dk2=v2
  • Program argument java -jar my.jar --k1=v1 --k2=v2
  • Use an external application.properties file and pointing to it with export spring.config.location=/tmp/application.properties or passing it in with java parameter -Dspring.config.location=/tmp/application.properties


No comments: