Search code examples
spring-bootspring-boot-2

Spring-Boot 2.3.1 -Dspring-boot.run.arguments not working


I have been using mvn spring-boot:run command with -Dspring-boot.run.arguments to pass arguments/variables to our spring-boot application, ex:

mvn spring-boot:run -Dspring-boot.run.arguments=--jwt.validateExp=false,--jwt.skipValidation=true

And in the application, I used to read the argument value using annotation: @Value("${jwt.skipValidation}"). This was working fine with spring-boot 2.2.1.

When I upgraded to spring-boot 2.3.1, this stopped working. Any suggestion?


Solution

  • Changing --jwt.validateExp=false,--jwt.skipValidation=true to "--jwt.validateExp=false --jwt.skipValidation=true", did the trick for me.

    mvn spring-boot:run -Dspring-boot.run.arguments="--jwt.validateExp=false --jwt.skipValidation=true"
    

    So placed double quotes ("") around the arguments, and provided space in place of comma (,).