how can I add an arguments in maven command line defined as VM option. In Intellij I have the configuration
java 11 -Djasypt.encryptor.password=xxx
That solution works perfectly when I am reading VM option using @Value annotation in configuration class.
@Value("${jasypt.encryptor.password}")
private String jasyptEncryptorPassword;
I am using following command mvn -Djasypt.encryptor.password=xx spring-boot:run But it failed to fetch with following error.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jasyptConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'jasypt.encryptor.password' in value "${jasypt.encryptor.password}"
Only for command java -jar is possible to attach VM options ?