3 ways Spring boot release jar package, pass parameters

1, a way

java -jar x.jar a b c  

By main (String [] args), passed to args

 

2. Second way 
 

java -jar x.jar -Db -da = 111 = 222 = 3333 DC

( "A") by the System.getProperty; acquisition mode. As an environment variable

 

3. The third approach 

java -jar x.jar --a=111 --b=2222

Springboot wording is supported, can be obtained by @Value ( "$ {a}")

Published 39 original articles · won praise 1 · views 8800

Guess you like

Origin blog.csdn.net/oDengTao/article/details/96312785