-
Notifications
You must be signed in to change notification settings - Fork 84
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
Apply properties from profiles that are active by default #24
base: master
Are you sure you want to change the base?
Conversation
When using continuous delivery friendly version numbers with variables, such variables can be either set externally (-D...) or via a profile property. While the former works, the later does not. To fix this properties from profiles that are active by default are now merged into the effective model.
if (profile.getActivation() != null && profile.getActivation().isActiveByDefault()) { | ||
Properties merged = new Properties(); | ||
merged.putAll(profile.getProperties()); | ||
merged.putAll(model.getProperties()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, the properties from the model need to be added to merged
properties before the properties from the profile. Properties defined in a profile overwrite the ones in the model.
Sorry, for the late response - I was totally under water with lots of other OSS and closed projects. Thanks for your PR. So far from the theory. In practice you of course can already inject variables via system properties as you pointed out. In the end we can not prevent a user from doing something wrong here. However, what IMHO should be is that profiles are not triggered by default and this also implies profiles active by default. Why is that? There are tons of maven projects out there that use default profiles for local environment as simplification and use profile triggers to disable them in CI or for deployment builds. My suggestion would therefore be to add a new property to flatten mojo that is false by default and if activated will trigger the feature that you implemented here. This would also guarantee compatibility when we bring this out in an upcoming version of this plugin (to have reproducible builds even if plugin versions are not specified and upgrading the plugin does not break the behavior in a way where only downgrading brings back the old behavior). Do you see my point and agree? Would you even be willing to update your fork and this PR accordingly? |
was this feature implemented somewhere else? |
Not AFAIK. I fear that we create a feature that will cause releases to contain POMs with passwords from |
When using continuous delivery friendly version numbers with variables,
such variables can be either set externally (-D...) or via a profile
property. While the former works, the later does not. To fix this
properties from profiles that are active by default are now merged into
the effective model.