A library I need to use reads system property in the following way:
System.getProperty("library.system.property")
Is there any way to pass such a property to spring boot while starting the app or do I need to set it in the system?
Update 2020-01-08
For spring-boot 2.2.2.RELEASE while develop
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dmy_-Dmy_system_properties=test1"
For spring-boot 1.5.x.RELEASE or below while develop
mvn spring-boot:run -Drun.jvmArguments="-Dmy_system_properties=test1"
For run as jar
java -Dmy_system_properties=test1 -jar service.jar
You can try with a runnable example, here https://www.surasint.com/spring-boot-pass-system-properties-in-command-line/
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