24.3 Application Property Files uses the following command to add an application property spring.config.name
:
$ java -jar myproject.jar --spring.config.name=myproject
How can I do this with gradle bootRun
?
BootRun task extends JavaExec task: https://docs.spring.io/spring-boot/docs/2.0.4.RELEASE/gradle-plugin/api/org/springframework/boot/gradle/tasks/run/BootRun.html
Since Gradle 4.9, the command line arguments can be passed with --args. For example, if you want to launch the application with command line arguments foo --bar, you can use:
gradle bootRun --args='--spring.config.name=myproject'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With