[
https://issues.apache.org/jira/browse/MNG-5948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15060906#comment-15060906
]
Krzysztof Trojan commented on MNG-5948:
---------------------------------------
Indeed I was confused, however the confusion comes from the fact that for Maven
3.0.X @property config also enabled uwagÄ™ of the configuration entry with the
tag being the property name. This was changed, and I could not find any mention
of the change. Closing, however it would be good to add the note about the
change, possibly in plugin API docs?
> Parameter values are only injected from plugin configuration if the config
> value is identical to variable names.
> ----------------------------------------------------------------------------------------------------------------
>
> Key: MNG-5948
> URL: https://issues.apache.org/jira/browse/MNG-5948
> Project: Maven
> Issue Type: Bug
> Components: core
> Affects Versions: 3.3.3
> Reporter: Krzysztof Trojan
> Attachments: param-issue-demo-maven-plugin.zip
>
>
> In Maven 3.3.x it was observed that the Mojo field, being a parameter
> (annotated @Parameter either in Javadoc or in Java annotation), is only
> injected a value if in configuration a property is given with the exact same
> name. The "property" attribute of the @Parameter annotation seems not to make
> to read the value from a property named in the attribute.
> Example:
> {code}
> @Mojo( name = "something" )
> public class ExampleMojo extends AbstractMojo
> {
> @Parameter( property = "propertyIWant" )
> private String myParam;
> // truncated
> {code}
> does inject anything into myParam from a pom.xml with the config below in the
> plugin configuration:
> {code:xml}
> <configuration>
> <propertyIWant>something to inject</propertyIWant>
> </configuration>
> {code}
> While:
> {code:xml}
> <configuration>
> <myParam>something to inject</myParam>
> </configuration>
> {code}
> works nicely.
> This is regression comparing to Maven 3.0.x, where the same plugin works and
> gets values from the config entry named as in @Parameter(property)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)