How to pass environment variables to Maven on command line?

1

I want to pass values of environment variables to Maven via the command line. How to do?

Attempts:

  • mvn liquibase:update -Dliquibase.url=$DB_URL : Maven runs, but the value is not passed

  • mvn liquibase:update -Dliquibase.url=${DB_URL} : Maven runs, but the value is not passed

  • mvn liquibase:update -Dliquibase.url=${env.DB_URL} : bash error:

  

-bash: -Dliquibase.url = $ {env.DB_URL}: bad substitution

    
asked by anonymous 24.11.2018 / 00:44

1 answer

1

My failure.

The mvn liquibase:update -Dliquibase.url=$DB_URL command works.
I thought it did not work because Liquibase was not getting the parameters, but it's another problem.

    
26.11.2018 / 17:22