[
https://issues.apache.org/jira/browse/MNG-5948?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Krzysztof Trojan updated MNG-5948:
----------------------------------
Description:
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:
@Mojo( name = "something" )
public class ExampleMojo extends AbstractMojo
{
@Parameter( property = "propertyIWant" )
private String myParam;
// truncated
does inject anything into myParam from a pom.xml with the config below in the
plugin configuration:
<configuration>
<propertyIWant>something to inject</propertyIWant>
</configuration>
While:
<configuration>
<myParam>something to inject</myParam>
</configuration>
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)
was:
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:
{{@Mojo( name = "something" )
public class ExampleMojo extends AbstractMojo
{
@Parameter( property = "propertyIWant" )
private String myParam;
// truncated}}
does inject anything into myParam from a pom.xml with the config below in the
plugin configuration:
<configuration>
<propertyIWant>something to inject</propertyIWant>
</configuration>
While:
<configuration>
<myParam>something to inject</myParam>
</configuration>
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*)
> 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:
> @Mojo( name = "something" )
> public class ExampleMojo extends AbstractMojo
> {
> @Parameter( property = "propertyIWant" )
> private String myParam;
> // truncated
> does inject anything into myParam from a pom.xml with the config below in the
> plugin configuration:
> <configuration>
> <propertyIWant>something to inject</propertyIWant>
> </configuration>
> While:
> <configuration>
> <myParam>something to inject</myParam>
> </configuration>
> 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)