Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read environment variable in properties file #46

Closed
lcherukuri opened this issue Feb 9, 2018 · 2 comments
Closed

Read environment variable in properties file #46

lcherukuri opened this issue Feb 9, 2018 · 2 comments

Comments

@lcherukuri
Copy link

lcherukuri commented Feb 9, 2018

How to read system (mac:~/.profile) environment variables in a properties file. I created development and production properties files in environment folder like below

development.properties:
username=${db_username}
password=${db_password}

Now when I run mvn migration:status, i get following error

[ERROR] Failed to execute goal org.mybatis.maven:migrations-maven-plugin:1.1.3:status (default-cli) on project test: Execution default-cli of goal org.mybatis.maven:migrations-maven-plugin:1.1.3:status failed: Could not create SqlRunner. Cause: org.postgresql.util.PSQLException: FATAL: role "${db_username}" does not exist

plugin is not replacing variables. Am I doing it wrong or is this not supported by plugin?

@h3adache
Copy link
Member

Hi @lokeshcherukuri you have to enable maven filtering. This isn't on by default using migration maven plugin.

@hazendaz
Copy link
Member

closing old issue as filtering was necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants