You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (Jira)" <ji...@apache.org> on 2021/08/24 17:33:00 UTC
[jira] [Commented] (MNG-7138) Proper verify of plugin configuration
Bean set method call
[ https://issues.apache.org/jira/browse/MNG-7138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17403970#comment-17403970 ]
Robert Scholte commented on MNG-7138:
-------------------------------------
In the case of {{<beanParam>value</beanParam>}} I would expect a call of the constructor. If set() is called, it is either a bug or an unknown feature to me.
This is done by sisu.plexus, so maybe [~mcculls] can enlighten this.
> Proper verify of plugin configuration Bean set method call
> ----------------------------------------------------------
>
> Key: MNG-7138
> URL: https://issues.apache.org/jira/browse/MNG-7138
> Project: Maven
> Issue Type: Improvement
> Components: Integration Tests
> Reporter: Slawomir Jaranowski
> Priority: Major
>
> When we use custom {{Bean}} as {{plugin}} parameter configuration, {{set}} method of {{Bean}} is only called for default value.
> Example:
> {code:java}
> public class MyMojo extends AbstractMojo
> {
> @Parameter
> private Bean beanParam;
> }
> {code}
> {code:java}
> public class Bean
> {
> private String field1;
> private String field2;
> public void set(String value) {
> this.field1 = value;
> }
> }
> {code}
>
> And configuration with fields name:
> {code:xml}
> <configuration>
> <beanParam>
> <field1>value1</field1>
> <field2>value2</field2>
> </beanParam>
> </configuration>
> {code}
> in this case {{Bean.set}} is not called.
>
> When we have:
> {code:xml}
> <configuration>
> <beanParam>value</beanParam>
> </configuration>
> {code}
> {{Bean.set}} is called.
>
> I will fix it.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)