Hello everyone, I am currently studying graalvm native spring boot. I encountered such a problem during the research process. Could you please help me figure out how to solve it? When packaging into a jar in the past, the configuration file could be placed separately in the config folder at the same level as the jar. The advantage of this is that the configuration file can be modified dynamically, but graalvm cannot. I referred to the official website's method of referencing external resources and introduced application-prod.yml from other places, but it still didn't work. SpringBoot graalvm native spring boot how to load application.yml files

As you can see in the picture above, what I want to do is very simple, which is to specify a configuration file in application.yml when packaging. This configuration file is not under the project resource path. Then I wanted to introduce external configuration files into the project during packaging, but they all failed. Since the configuration file with the specified suffix cannot be found, the default port 8080 is still used during startup. GraalVM Native official website reference is as follows SpringBoot graalvm native spring boot how to load application.yml files GraalVM Native Doc1 GraalVM Native Doc2

Comment From: bclozel

You can use the RuntimeHints API to register additional resources in the native image. See the Spring Framework reference documentation about AOT runtime hints. For further questions, please use StackOverflow.