You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "M. Richey" <m....@gmx.de> on 2016/09/30 09:35:38 UTC

[Regression] Declared properties could not be modified anymore within a plugin

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. One can set the value of "myProp" to "newValue" in the (same) plugin, but after the execution of the plugin the value is "default" again. :(

With maven 3 it is working only if the property was not defined in the pom.xml before - so it is added during the execution of the plugin. But that is not an option. We do need properties with default values which can be modified eventually during the build.

Anyone else stumbled upon this problem? Is there a way to get it working again in maven 3? In my opinion this is a bug, but I couldn't find anything in JIRA. Thanks in advance.

Best regards,

Maik

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org