You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Slawomir Jaranowski (Jira)" <ji...@apache.org> on 2021/04/05 15:48:00 UTC
[jira] [Updated] (MNG-7133) Allow to inline collection/array items
within plugin root configuration
[ https://issues.apache.org/jira/browse/MNG-7133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Slawomir Jaranowski updated MNG-7133:
-------------------------------------
Description:
Currently we can have plugin configurations like:
{code:xml}
<configuration>
<listParam>
<listParam>Foo*</listParam>
<listParam>Bar*</listParam>
</listParam>
<configuration>
{code}
But when we have plugin configuration like:
{code:xml}
<configuration>
<listParam>Foo*</listParam>
<listParam>Bar*</listParam>
<configuration>
{code}
and add method {{addListParam}} to Plugin mojo class this is not working.
{{addListParam}} method on plugin level is *called only once*
Plugin code:
{code:java}
public class MyMojo extends AbstractMojo {
@Parameter
private List<String> listParam;
/**
* special method called when inline collection in configuration is used.
*/
public void addListParam(String value) {
listParam.add(value);
}
}
{code}
was:
Currently we can have plugin configurations like:
{code:xml}
<configuration>
<fileset>
<include>Foo*</include>
<include>Bar*</include>
<exclude>*Bad</exclude>
</fileset>
<configuration>
{code}
When we add method {{addInclude}} on class {{Fileset}} such configuration is working - according to issue: MNG-5033
But when we have plugin configuration like:
{code:xml}
<configuration>
<include>Foo*</include>
<include>Bar*</include>
<configuration>
{code}
and add method {{addInclude}} to Plugin mojo class this is not working.
{{addInclude}} method on plugin level is *called only once* - it looks like some code of plugin api allow inline include of collection but another place don't allow.
> Allow to inline collection/array items within plugin root configuration
> -----------------------------------------------------------------------
>
> Key: MNG-7133
> URL: https://issues.apache.org/jira/browse/MNG-7133
> Project: Maven
> Issue Type: Improvement
> Components: Plugins and Lifecycle
> Affects Versions: 3.6.3
> Reporter: Slawomir Jaranowski
> Priority: Major
>
> Currently we can have plugin configurations like:
> {code:xml}
> <configuration>
> <listParam>
> <listParam>Foo*</listParam>
> <listParam>Bar*</listParam>
> </listParam>
> <configuration>
> {code}
> But when we have plugin configuration like:
> {code:xml}
> <configuration>
> <listParam>Foo*</listParam>
> <listParam>Bar*</listParam>
> <configuration>
> {code}
> and add method {{addListParam}} to Plugin mojo class this is not working.
> {{addListParam}} method on plugin level is *called only once*
> Plugin code:
> {code:java}
> public class MyMojo extends AbstractMojo {
>
> @Parameter
> private List<String> listParam;
> /**
> * special method called when inline collection in configuration is used.
> */
> public void addListParam(String value) {
> listParam.add(value);
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)