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

allow properties to be defined in an external file #52

Open
jgangemi opened this issue Nov 22, 2014 · 2 comments
Open

allow properties to be defined in an external file #52

jgangemi opened this issue Nov 22, 2014 · 2 comments

Comments

@jgangemi
Copy link
Collaborator

i have all my application specific properties in an external file that gets pulled into the build via a filter for substitutions, etc - this lets me clean up the poms and keep build/application properties in separate places.

i'd like to be able to do this for properties i've defined in the docker maven config (eg bind ports, etc) and pull in the appropriate file based on the active profile.

it's possible this is already covered by the impending external configuration updates (i haven't looked at the code yet) but if it's not, i could see that being a big hit w/ that functionality.

thoughts? wiling to tackle this myself, just want to have a discussion first. :)

@jgangemi
Copy link
Collaborator Author

i looked into doing this using the maven properties plugin but i can't figure out how to cause the initialize phase to run w/o doing this mvn initialize docker:start or how i could get the read properties goal to run before docker:start does.

@rhuss
Copy link
Collaborator

rhuss commented Nov 24, 2014

Indeed with the new 'external' configuration this could be already possible (with some minor limitation concerning port- and environment mapping).

As you said, you can try the properties-maven-plugin but this needs to be run together with the docker goal. So you have either to provide both as goals (as you did) or bind both plugins to the same execution phase and then call the goal for this execution phae (e.g. bind both goals to the 'install' phase and they will run in the order they are declared in the pom.xml). The first solution is tedious, the second not nice because you have to bind to a standard maven goal and use this.

I think the best solution would be to add to PropertyConfigHandler to a new configuration propertyFile as extra configuration (given in the properties argument of this handler), and then use this for configuration (probably as a fallback if a property is not given directly in the pom.xml which should take precedence).

If you like, you can work on this, I'm still on the logging stuff.

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