maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <>
Subject Re: [Regression] Declared properties could not be modified anymore within a plugin
Date Sun, 02 Oct 2016 20:04:10 GMT
On Fri, Sep 30, 2016 at 1:50 PM, Karl Heinz Marbaise <> wrote:
> Hi,
> On 30/09/16 15:20, wrote:
>> Hi all,
>> we discovered a problem with properties defined in a pom.xml.
>> Properties could be defined in a pom.xml like:
>> <properties>
>> <myProp>default</myProp>
>> </properties>
>> In a maven plugin we fetch all the properties by calling:
>> Properties projectProps = project.getProperties();
>> Running all this with maven 2 we were able to modify the value of "myProp"
>> within the plugin by:
>> projectProps.put("myProp", "newValue");
>> So after the execution of the plugin, the property <myProp> has the value
>> "newValue".
>> Running all this with maven 3 that does not work anymore.
> First I would say this is by design wrong, cause if you define a property in
> the pom file I would like to be sure that it will be kept the value I have
> given and if a plugin (which could it be) will change that I will be really
> astonished.
> Apart from that my question: Why do you need to change existing properties
> and why not changing the in the pom which is more clearer than mysteriously
> chaning a property by a plugin?...
> Can you give more details about your use case ? Best would be having a real
> workign example and what kind of problems you are trying to solve with this
> approach?
> Kind regards
> Karl Heinz Marbaise
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Here's why this is important.

Consider a plugin with the job of setting a property, like many of the
build-helper goals, or the build-number plugin.

Now, consider an IDE. The IDEs don't, in general, know about these
plugins. They get confused when they don't have a value at all. So,
SOP is is to put a harmless default into the POM, and count on the
plugin overwriting it. I have some of these working with 3.3.9, so
there must be something more subtle going on.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message