java - Spring boot properties file override from command line -
i having problem spring boot , fat jar invocation command line.i trying overide property command line without success.
have parameter in code:
@value("${param1}") private string param1;
and have put application.properties file inside src\main\resources following content;
param1=param 1 value properties file
when build jar , run with:
java -jar java-apns-notifier-0.1.0.jar --param1=aaaaaaaaa
param1 printed value application.properties file , not takes account value command line.
project source code here
any idea?
you forgot pass arguments in application class. need change
springapplication.run(application.class);
to
springapplication.run(application.class, args);
Comments
Post a Comment