Open Helpstone opened 6 years ago
Which Maven version do you use?
Maven 3.5.2 and flatten-maven-plugin 1.0.1
Seems like an obvious bug. We should test this with the latest version and add an IT for it. If this bug is still present, we need to fix it.
I did not read carefully enough. Currently we are only interpolating variable expressions (${...}
) on flattening. What you are expecting is that a child element from properties
will also be overridden from commandline. I still see your expectation as this is also what happens during the maven build and it is a valid feature request, but it is not an obvious bug as I thought in the first place.
Assume a pom.xml with properties like this:
When calling maven with
mvn -Dbuild.number=123
, I would expect to get the following properties in the flattened-pomBut what I get is
I did not peek into the code, but probably the properties are retrieved with project.getProperties() only, which do reflect explicit set properties for substitutions only, but not in their own definition. So session.getUserProperties() should be used for overwritten properties.