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

Ability to reuse variables in other declarations #17

Open
lmajano opened this issue May 16, 2020 · 2 comments
Open

Ability to reuse variables in other declarations #17

lmajano opened this issue May 16, 2020 · 2 comments

Comments

@lmajano
Copy link

lmajano commented May 16, 2020

By nature the normal java properties files API does NOT allow you to reuse variables in other declarations. Example:

DB_HOST=localhost
DB_CONNECTIONSTRING=jdbc:mysql://${DB_HOST}:3306/fluentapi?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&useLegacyDatetimeCode=true

This is extremely useful to create compose variables especially for reuse. However, you will need a new jar file to process these replacements. This can be used using apache commons or just a post-processor in cfml which can go over each key value and process them for replacements.

@bdw429s
Copy link
Contributor

bdw429s commented Dec 17, 2020

Should this be implemented in this library or in the underlying propertyFile lib which is what you use directly in the

propertyfile show

command. Furthermore, should the replacements only replace other keys in the same file, or ANY env vars that exist?

@ghost
Copy link

ghost commented Jun 25, 2021

a Plus 1 from me, I do not think the underlying property lib should change and any replacements should take place at the time of execution so

DB_HOST=localhost
DB_CONNECTIONSTRING=jdbc:mysql://${DB_HOST}:3306/fluentapi
echo DB_CONNECTIONSTRING -> jdbc:mysql://localhost:3306/fluentapi
DB_HOST=192.168.0.1
echo DB_CONNECTIONSTRING -> jdbc:mysql://localhost:3306/fluentapi

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

2 participants