[ 
https://issues.apache.org/jira/browse/MNG-5948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15056319#comment-15056319
 ] 

Robert Scholte commented on MNG-5948:
-------------------------------------

I think you are confusing {{alias}} and {{property}}. With alias you can change 
the name used within the configuration-block of the plugin, whereas property 
refers to the {{-Dkey=value}}

> 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)

Reply via email to