developer747
developer747

Reputation: 15928

Spring boot java, use one property in another

This is a simplified example of what i am trying to achieve.

This is how the propertes file of my spring boot application looks like

someProp=4

command=java -jar -DdummyProp={someProp} hello.jar

I want value of someprop to be set dynamically (passed in from commandline) and that be plugged into another property (in this case into the property called command).

Can this be done without physically writing into the file (in memory)?

Upvotes: 0

Views: 261

Answers (1)

Biju Kunjummen
Biju Kunjummen

Reputation: 49915

you can do this:

command=java -jar -DdummyProp=${someProp} hello.jar

Upvotes: 2

Related Questions