Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.9, 2.1.0-M1
-
Fix Version/s: 3.0-alpha-3
-
Component/s: Inheritance and Interpolation
-
Labels:None
-
Complexity:Intermediate
Description
My plugin has a configuration like this:
/**
* My Properties.
*
* @parameter
*/
private Properties myProperties;
When I configure like this:
<myProperties>
<property>
<name>propertyName1</name>
<value>${buildnumber}</value> <!-- property injected on maven properties by http://mojo.codehaus.org/buildnumber-maven-plugin/ -->
<property>
</myProperties>
Maven doesn't interpolate the buildnumber. But the value is available at project.getProperties().
This is related to the version of the plexus container we're using in maven. With more recent versions, the PropertiesConverter (used to convert XML to a Properties instance for plugin parameter injection) does evaluate embedded expressions. However, as of 1.0-alpha-9 of the plexus container, this new code was not in place.
It seems we have two options for fixing this:
1. create a maintenance branch based on plexus 1.0-alpha-9 and fix the PropertiesConverter there, then release a new revision for use in maven
2. move maven onto a more recent plexus version, which will entail quite a bit of work since the component model has changed in important ways since alpha-9.
My personal opinion is that #2 is preferable if it's reasonably easy to do (not sure on this). This would modernize Maven WRT the plexus container, and enable us to track a little more closely with the progress in plexus in future. However, we could fix the PropertiesConverter itself very quickly, making #1 a much more expedient option.