You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Elliotte Rusty Harold (Jira)" <ji...@apache.org> on 2019/12/20 14:43:00 UTC

[jira] [Resolved] (MNG-5948) Parameter values are only injected from plugin configuration if the config value is identical to variable names.

     [ https://issues.apache.org/jira/browse/MNG-5948?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Elliotte Rusty Harold resolved MNG-5948.
----------------------------------------
    Resolution: Invalid

> 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
>            Priority: Major
>         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
(v8.3.4#803005)