When running a Spring Boot app using a jar-file, I can specify what profile and configuration file to use as:
SPRING_PROFILES_ACTIVE=p1 SPRING_CONFIG_LOCATION=file:runtime-configuration/application.yaml java -jar app.jar
But when running a Spring Boot app from a CRaC checkpoint, these env variables seem to be ignored, like:
SPRING_PROFILES_ACTIVE=p1 SPRING_CONFIG_LOCATION=file:runtime-configuration/application.yaml java -XX:CRaCRestoreFrom=checkpoint
The CRaC checkpoint was created with the command:
java -Dspring.context.checkpoint=onRefresh -XX:CRaCCheckpointTo=checkpoint -jar app.jar
Can I add some custom code in my app to reload the config file and set the active profile when I start the application?