You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Chris Graham <ch...@gmail.com> on 2013/05/06 15:06:49 UTC

Regression? Plugin Parameter Injection

Hey All.

I'm not sure if I've found a regression issue with Maven 3.0.x (tried with
all versions beta-1 onwards to 3.0.5) or not. V3.x behaves differently to
2.09, 2.0.11 and 2.2.1.

I've written a plugin for WebSphere Message Broker; basically it's a
wrapper for the underlying mqsicreatebar tool.

Amongst other things, it takes zero or more message sets and message flows.
To handle this, I defined the parameters as an array.

Here is the snippet from the plugin's source:
    /**
     * The message flows to be added to the bar file.
     * @parameter expression="${msgFlows}"
     * @required
     */
    private String[] msgFlows;

    /**
     * The message sets to be added to the bar file.
     * @parameter expression="${msgSets}"
     * @required
     */
    private String[] msgSets;

and here is an example configuration section from a pom that uses the
plugin:

                <configuration>
                    <skipApplyOverrides>false</skipApplyOverrides>
                    <isV60>true</isV60>
                    <workspace>${wmbtk.workspace.root}/24a</workspace>
                    <msgFlows>

<msgFlow>MFP_Project/com/blah/MFL_DiagFlow.msgflow</msgFlow>
                    </msgFlows>
                    <msgSets>
                        <msgSet />
                    </msgSets>
                </configuration>

So we have one message flow, but no message sets.

Here is where the differences are seen.

Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.

Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single element of
null.

My question boils down to: is this the desired behaviour?

I've had to adjust my code to work under Maven 3.x (which I didn't think
that I had too).

>From memory, I can not supply an empty <msgSets/> element (but I need to
check that).

-Chris

Re: Regression? Plugin Parameter Injection

Posted by Brett Porter <br...@porterclan.net>.
On 06/05/2013, at 11:06 PM, Chris Graham <ch...@gmail.com> wrote:

> Here is where the differences are seen.
> 
> Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.
> 
> Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single element of
> null.
> 
> My question boils down to: is this the desired behaviour?
> 

That's the behaviour I would have expected to see, so I'd say Maven 3.x is more correct.

> 
> From memory, I can not supply an empty <msgSets/> element (but I need to
> check that).

That'd be good to know - I'd expect that to work and either be null or (better) an empty array or list...

- Brett

--
Brett Porter
brett@apache.org
http://brettporter.wordpress.com/
http://au.linkedin.com/in/brettporter
http://twitter.com/brettporter






---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Regression? Plugin Parameter Injection

Posted by Chris Graham <ch...@gmail.com>.
Done. issue created.

MNG-5476 <http://jira.codehaus.org/browse/MNG-5476> covers it.

-Chris



On Wed, May 8, 2013 at 9:36 AM, Chris Graham <ch...@gmail.com> wrote:

> WIll do, ta.
>
> -Chris
>
>
> On Tue, May 7, 2013 at 11:42 PM, Stuart McCulloch <mc...@gmail.com>wrote:
>
>> On 7 May 2013, at 09:00, Chris Graham wrote:
>>
>> > I agree, the way that I have to enter the pom under 2.0.9 is now
>> correctly
>> > reflected by 3.x.
>> >
>> > However, the second part of the issue that I found is that the
>> @required is
>> > beting totally ignored! 2.x enforces it, 3.x does not, it should.
>> >
>> > That I believe does need to be fixed, and that should be the simplest of
>> > test cases.
>>
>> The @required issue only seems to occur when you give a default
>> expression, so it's probably down to how "${someProperty}" is interpreted -
>> if you log an issue I can take a look when I get back
>>
>> > -Chris
>> >
>> > On Tue, May 7, 2013 at 10:17 PM, Stuart McCulloch <mc...@gmail.com>
>> wrote:
>> >
>> >> On 6 May 2013, at 23:49, Chris Graham wrote:
>> >>
>> >>> Looking at that issue, if the issue was meant to deal with the example
>> >>> given, ie, and array of strings, then the issue is most certainly not
>> >>> fixed, as it is my exact case.
>> >>
>> >> The issue addressed making the behaviour more consistent, which it
>> does -
>> >> iirc the same XML configuration injected into a list would give a list
>> with
>> >> one element, so for the array case I'd expect a one element array.
>> >>
>> >>> Either way, as that behaviour is in published versions, my plugin
>> needs
>> >> to
>> >>> be able to deal with both cases.
>> >>>
>> >>> From my example,
>> >>>                   <msgSets>
>> >>>                       <msgSet />
>> >>>                   </msgSets>
>> >>>
>> >>>
>> >>> It is giving me precisely what the pom says. An arrary, of one null
>> >> element.
>> >>>
>> >>> It just surprised me that the behaviour changed when compared to 2.x.
>> >> Were
>> >>> I got a null array.
>> >>
>> >> Various undefined or inconsistent behaviour was cleaned up and made
>> >> consistent rather than carry-over broken/odd behaviour.
>> >>
>> >>> it's really up to you guys to decide if it's a) worth 'fixing' or if
>> that
>> >>> is indeed the desired behaviour.
>> >>
>> >> I don't mind fixing bugs as long as there a clear testcase, but I
>> think it
>> >> would be a mistake to start special-casing injected arrays vs
>> collections.
>> >>
>> >>> I'll see if I can get <msgSets/> to pass parsing, as that should also
>> >> work.
>> >>>
>> >>> -Chris
>> >>>
>> >>>
>> >>>
>> >>> On Tue, May 7, 2013 at 1:25 PM, Stuart McCulloch <mc...@gmail.com>
>> >> wrote:
>> >>>
>> >>>> Actually I think it might be a side-effect of the following
>> >>>> feature/improvement made for M3:
>> >>>>
>> >>>>       https://issues.sonatype.org/browse/SISU-58
>> >>>>
>> >>>> where the code to handle arrays was made more consistent wrt. the
>> >> handling
>> >>>> of collections.
>> >>>>
>> >>>> On 6 May 2013, at 12:35, Hervé BOUTEMY wrote:
>> >>>>
>> >>>>> looks like a subtle change in injection when moving from Plexus to
>> >> Guice
>> >>>>>
>> >>>>> Regards,
>> >>>>>
>> >>>>> Hervé
>> >>>>>
>> >>>>> Le lundi 6 mai 2013 23:06:49 Chris Graham a écrit :
>> >>>>>> Hey All.
>> >>>>>>
>> >>>>>> I'm not sure if I've found a regression issue with Maven 3.0.x
>> (tried
>> >>>> with
>> >>>>>> all versions beta-1 onwards to 3.0.5) or not. V3.x behaves
>> differently
>> >>>> to
>> >>>>>> 2.09, 2.0.11 and 2.2.1.
>> >>>>>>
>> >>>>>> I've written a plugin for WebSphere Message Broker; basically it's
>> a
>> >>>>>> wrapper for the underlying mqsicreatebar tool.
>> >>>>>>
>> >>>>>> Amongst other things, it takes zero or more message sets and
>> message
>> >>>> flows.
>> >>>>>> To handle this, I defined the parameters as an array.
>> >>>>>>
>> >>>>>> Here is the snippet from the plugin's source:
>> >>>>>>  /**
>> >>>>>>   * The message flows to be added to the bar file.
>> >>>>>>   * @parameter expression="${msgFlows}"
>> >>>>>>   * @required
>> >>>>>>   */
>> >>>>>>  private String[] msgFlows;
>> >>>>>>
>> >>>>>>  /**
>> >>>>>>   * The message sets to be added to the bar file.
>> >>>>>>   * @parameter expression="${msgSets}"
>> >>>>>>   * @required
>> >>>>>>   */
>> >>>>>>  private String[] msgSets;
>> >>>>>>
>> >>>>>> and here is an example configuration section from a pom that uses
>> the
>> >>>>>> plugin:
>> >>>>>>
>> >>>>>>              <configuration>
>> >>>>>>                  <skipApplyOverrides>false</skipApplyOverrides>
>> >>>>>>                  <isV60>true</isV60>
>> >>>>>>                  <workspace>${wmbtk.workspace.root}/24a</workspace>
>> >>>>>>                  <msgFlows>
>> >>>>>>
>> >>>>>> <msgFlow>MFP_Project/com/blah/MFL_DiagFlow.msgflow</msgFlow>
>> >>>>>>                  </msgFlows>
>> >>>>>>                  <msgSets>
>> >>>>>>                      <msgSet />
>> >>>>>>                  </msgSets>
>> >>>>>>              </configuration>
>> >>>>>>
>> >>>>>> So we have one message flow, but no message sets.
>> >>>>>>
>> >>>>>> Here is where the differences are seen.
>> >>>>>>
>> >>>>>> Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.
>> >>>>>>
>> >>>>>> Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single
>> >> element
>> >>>> of
>> >>>>>> null.
>> >>>>>>
>> >>>>>> My question boils down to: is this the desired behaviour?
>> >>>>>>
>> >>>>>> I've had to adjust my code to work under Maven 3.x (which I didn't
>> >> think
>> >>>>>> that I had too).
>> >>>>>>
>> >>>>>> From memory, I can not supply an empty <msgSets/> element (but I
>> need
>> >> to
>> >>>>>> check that).
>> >>>>>>
>> >>>>>> -Chris
>> >>>>>
>> >>>>>
>> ---------------------------------------------------------------------
>> >>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> >>>>> For additional commands, e-mail: dev-help@maven.apache.org
>> >>>>>
>> >>>>
>> >>>>
>> >>>> ---------------------------------------------------------------------
>> >>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> >>>> For additional commands, e-mail: dev-help@maven.apache.org
>> >>>>
>> >>>>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: dev-help@maven.apache.org
>> >>
>> >>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>

Re: Regression? Plugin Parameter Injection

Posted by Chris Graham <ch...@gmail.com>.
WIll do, ta.

-Chris


On Tue, May 7, 2013 at 11:42 PM, Stuart McCulloch <mc...@gmail.com> wrote:

> On 7 May 2013, at 09:00, Chris Graham wrote:
>
> > I agree, the way that I have to enter the pom under 2.0.9 is now
> correctly
> > reflected by 3.x.
> >
> > However, the second part of the issue that I found is that the @required
> is
> > beting totally ignored! 2.x enforces it, 3.x does not, it should.
> >
> > That I believe does need to be fixed, and that should be the simplest of
> > test cases.
>
> The @required issue only seems to occur when you give a default
> expression, so it's probably down to how "${someProperty}" is interpreted -
> if you log an issue I can take a look when I get back
>
> > -Chris
> >
> > On Tue, May 7, 2013 at 10:17 PM, Stuart McCulloch <mc...@gmail.com>
> wrote:
> >
> >> On 6 May 2013, at 23:49, Chris Graham wrote:
> >>
> >>> Looking at that issue, if the issue was meant to deal with the example
> >>> given, ie, and array of strings, then the issue is most certainly not
> >>> fixed, as it is my exact case.
> >>
> >> The issue addressed making the behaviour more consistent, which it does
> -
> >> iirc the same XML configuration injected into a list would give a list
> with
> >> one element, so for the array case I'd expect a one element array.
> >>
> >>> Either way, as that behaviour is in published versions, my plugin needs
> >> to
> >>> be able to deal with both cases.
> >>>
> >>> From my example,
> >>>                   <msgSets>
> >>>                       <msgSet />
> >>>                   </msgSets>
> >>>
> >>>
> >>> It is giving me precisely what the pom says. An arrary, of one null
> >> element.
> >>>
> >>> It just surprised me that the behaviour changed when compared to 2.x.
> >> Were
> >>> I got a null array.
> >>
> >> Various undefined or inconsistent behaviour was cleaned up and made
> >> consistent rather than carry-over broken/odd behaviour.
> >>
> >>> it's really up to you guys to decide if it's a) worth 'fixing' or if
> that
> >>> is indeed the desired behaviour.
> >>
> >> I don't mind fixing bugs as long as there a clear testcase, but I think
> it
> >> would be a mistake to start special-casing injected arrays vs
> collections.
> >>
> >>> I'll see if I can get <msgSets/> to pass parsing, as that should also
> >> work.
> >>>
> >>> -Chris
> >>>
> >>>
> >>>
> >>> On Tue, May 7, 2013 at 1:25 PM, Stuart McCulloch <mc...@gmail.com>
> >> wrote:
> >>>
> >>>> Actually I think it might be a side-effect of the following
> >>>> feature/improvement made for M3:
> >>>>
> >>>>       https://issues.sonatype.org/browse/SISU-58
> >>>>
> >>>> where the code to handle arrays was made more consistent wrt. the
> >> handling
> >>>> of collections.
> >>>>
> >>>> On 6 May 2013, at 12:35, Hervé BOUTEMY wrote:
> >>>>
> >>>>> looks like a subtle change in injection when moving from Plexus to
> >> Guice
> >>>>>
> >>>>> Regards,
> >>>>>
> >>>>> Hervé
> >>>>>
> >>>>> Le lundi 6 mai 2013 23:06:49 Chris Graham a écrit :
> >>>>>> Hey All.
> >>>>>>
> >>>>>> I'm not sure if I've found a regression issue with Maven 3.0.x
> (tried
> >>>> with
> >>>>>> all versions beta-1 onwards to 3.0.5) or not. V3.x behaves
> differently
> >>>> to
> >>>>>> 2.09, 2.0.11 and 2.2.1.
> >>>>>>
> >>>>>> I've written a plugin for WebSphere Message Broker; basically it's a
> >>>>>> wrapper for the underlying mqsicreatebar tool.
> >>>>>>
> >>>>>> Amongst other things, it takes zero or more message sets and message
> >>>> flows.
> >>>>>> To handle this, I defined the parameters as an array.
> >>>>>>
> >>>>>> Here is the snippet from the plugin's source:
> >>>>>>  /**
> >>>>>>   * The message flows to be added to the bar file.
> >>>>>>   * @parameter expression="${msgFlows}"
> >>>>>>   * @required
> >>>>>>   */
> >>>>>>  private String[] msgFlows;
> >>>>>>
> >>>>>>  /**
> >>>>>>   * The message sets to be added to the bar file.
> >>>>>>   * @parameter expression="${msgSets}"
> >>>>>>   * @required
> >>>>>>   */
> >>>>>>  private String[] msgSets;
> >>>>>>
> >>>>>> and here is an example configuration section from a pom that uses
> the
> >>>>>> plugin:
> >>>>>>
> >>>>>>              <configuration>
> >>>>>>                  <skipApplyOverrides>false</skipApplyOverrides>
> >>>>>>                  <isV60>true</isV60>
> >>>>>>                  <workspace>${wmbtk.workspace.root}/24a</workspace>
> >>>>>>                  <msgFlows>
> >>>>>>
> >>>>>> <msgFlow>MFP_Project/com/blah/MFL_DiagFlow.msgflow</msgFlow>
> >>>>>>                  </msgFlows>
> >>>>>>                  <msgSets>
> >>>>>>                      <msgSet />
> >>>>>>                  </msgSets>
> >>>>>>              </configuration>
> >>>>>>
> >>>>>> So we have one message flow, but no message sets.
> >>>>>>
> >>>>>> Here is where the differences are seen.
> >>>>>>
> >>>>>> Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.
> >>>>>>
> >>>>>> Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single
> >> element
> >>>> of
> >>>>>> null.
> >>>>>>
> >>>>>> My question boils down to: is this the desired behaviour?
> >>>>>>
> >>>>>> I've had to adjust my code to work under Maven 3.x (which I didn't
> >> think
> >>>>>> that I had too).
> >>>>>>
> >>>>>> From memory, I can not supply an empty <msgSets/> element (but I
> need
> >> to
> >>>>>> check that).
> >>>>>>
> >>>>>> -Chris
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>>>> For additional commands, e-mail: dev-help@maven.apache.org
> >>>>>
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: dev-help@maven.apache.org
> >>>>
> >>>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Regression? Plugin Parameter Injection

Posted by Stuart McCulloch <mc...@gmail.com>.
On 7 May 2013, at 09:00, Chris Graham wrote:

> I agree, the way that I have to enter the pom under 2.0.9 is now correctly
> reflected by 3.x.
> 
> However, the second part of the issue that I found is that the @required is
> beting totally ignored! 2.x enforces it, 3.x does not, it should.
> 
> That I believe does need to be fixed, and that should be the simplest of
> test cases.

The @required issue only seems to occur when you give a default expression, so it's probably down to how "${someProperty}" is interpreted - if you log an issue I can take a look when I get back

> -Chris
> 
> On Tue, May 7, 2013 at 10:17 PM, Stuart McCulloch <mc...@gmail.com> wrote:
> 
>> On 6 May 2013, at 23:49, Chris Graham wrote:
>> 
>>> Looking at that issue, if the issue was meant to deal with the example
>>> given, ie, and array of strings, then the issue is most certainly not
>>> fixed, as it is my exact case.
>> 
>> The issue addressed making the behaviour more consistent, which it does -
>> iirc the same XML configuration injected into a list would give a list with
>> one element, so for the array case I'd expect a one element array.
>> 
>>> Either way, as that behaviour is in published versions, my plugin needs
>> to
>>> be able to deal with both cases.
>>> 
>>> From my example,
>>>                   <msgSets>
>>>                       <msgSet />
>>>                   </msgSets>
>>> 
>>> 
>>> It is giving me precisely what the pom says. An arrary, of one null
>> element.
>>> 
>>> It just surprised me that the behaviour changed when compared to 2.x.
>> Were
>>> I got a null array.
>> 
>> Various undefined or inconsistent behaviour was cleaned up and made
>> consistent rather than carry-over broken/odd behaviour.
>> 
>>> it's really up to you guys to decide if it's a) worth 'fixing' or if that
>>> is indeed the desired behaviour.
>> 
>> I don't mind fixing bugs as long as there a clear testcase, but I think it
>> would be a mistake to start special-casing injected arrays vs collections.
>> 
>>> I'll see if I can get <msgSets/> to pass parsing, as that should also
>> work.
>>> 
>>> -Chris
>>> 
>>> 
>>> 
>>> On Tue, May 7, 2013 at 1:25 PM, Stuart McCulloch <mc...@gmail.com>
>> wrote:
>>> 
>>>> Actually I think it might be a side-effect of the following
>>>> feature/improvement made for M3:
>>>> 
>>>>       https://issues.sonatype.org/browse/SISU-58
>>>> 
>>>> where the code to handle arrays was made more consistent wrt. the
>> handling
>>>> of collections.
>>>> 
>>>> On 6 May 2013, at 12:35, Hervé BOUTEMY wrote:
>>>> 
>>>>> looks like a subtle change in injection when moving from Plexus to
>> Guice
>>>>> 
>>>>> Regards,
>>>>> 
>>>>> Hervé
>>>>> 
>>>>> Le lundi 6 mai 2013 23:06:49 Chris Graham a écrit :
>>>>>> Hey All.
>>>>>> 
>>>>>> I'm not sure if I've found a regression issue with Maven 3.0.x (tried
>>>> with
>>>>>> all versions beta-1 onwards to 3.0.5) or not. V3.x behaves differently
>>>> to
>>>>>> 2.09, 2.0.11 and 2.2.1.
>>>>>> 
>>>>>> I've written a plugin for WebSphere Message Broker; basically it's a
>>>>>> wrapper for the underlying mqsicreatebar tool.
>>>>>> 
>>>>>> Amongst other things, it takes zero or more message sets and message
>>>> flows.
>>>>>> To handle this, I defined the parameters as an array.
>>>>>> 
>>>>>> Here is the snippet from the plugin's source:
>>>>>>  /**
>>>>>>   * The message flows to be added to the bar file.
>>>>>>   * @parameter expression="${msgFlows}"
>>>>>>   * @required
>>>>>>   */
>>>>>>  private String[] msgFlows;
>>>>>> 
>>>>>>  /**
>>>>>>   * The message sets to be added to the bar file.
>>>>>>   * @parameter expression="${msgSets}"
>>>>>>   * @required
>>>>>>   */
>>>>>>  private String[] msgSets;
>>>>>> 
>>>>>> and here is an example configuration section from a pom that uses the
>>>>>> plugin:
>>>>>> 
>>>>>>              <configuration>
>>>>>>                  <skipApplyOverrides>false</skipApplyOverrides>
>>>>>>                  <isV60>true</isV60>
>>>>>>                  <workspace>${wmbtk.workspace.root}/24a</workspace>
>>>>>>                  <msgFlows>
>>>>>> 
>>>>>> <msgFlow>MFP_Project/com/blah/MFL_DiagFlow.msgflow</msgFlow>
>>>>>>                  </msgFlows>
>>>>>>                  <msgSets>
>>>>>>                      <msgSet />
>>>>>>                  </msgSets>
>>>>>>              </configuration>
>>>>>> 
>>>>>> So we have one message flow, but no message sets.
>>>>>> 
>>>>>> Here is where the differences are seen.
>>>>>> 
>>>>>> Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.
>>>>>> 
>>>>>> Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single
>> element
>>>> of
>>>>>> null.
>>>>>> 
>>>>>> My question boils down to: is this the desired behaviour?
>>>>>> 
>>>>>> I've had to adjust my code to work under Maven 3.x (which I didn't
>> think
>>>>>> that I had too).
>>>>>> 
>>>>>> From memory, I can not supply an empty <msgSets/> element (but I need
>> to
>>>>>> check that).
>>>>>> 
>>>>>> -Chris
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>>> 
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>> 
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Regression? Plugin Parameter Injection

Posted by Chris Graham <ch...@gmail.com>.
I agree, the way that I have to enter the pom under 2.0.9 is now correctly
reflected by 3.x.

However, the second part of the issue that I found is that the @required is
beting totally ignored! 2.x enforces it, 3.x does not, it should.

That I believe does need to be fixed, and that should be the simplest of
test cases.

-Chris



On Tue, May 7, 2013 at 10:17 PM, Stuart McCulloch <mc...@gmail.com> wrote:

> On 6 May 2013, at 23:49, Chris Graham wrote:
>
> > Looking at that issue, if the issue was meant to deal with the example
> > given, ie, and array of strings, then the issue is most certainly not
> > fixed, as it is my exact case.
>
> The issue addressed making the behaviour more consistent, which it does -
> iirc the same XML configuration injected into a list would give a list with
> one element, so for the array case I'd expect a one element array.
>
> > Either way, as that behaviour is in published versions, my plugin needs
> to
> > be able to deal with both cases.
> >
> > From my example,
> >                    <msgSets>
> >                        <msgSet />
> >                    </msgSets>
> >
> >
> > It is giving me precisely what the pom says. An arrary, of one null
> element.
> >
> > It just surprised me that the behaviour changed when compared to 2.x.
> Were
> > I got a null array.
>
> Various undefined or inconsistent behaviour was cleaned up and made
> consistent rather than carry-over broken/odd behaviour.
>
> > it's really up to you guys to decide if it's a) worth 'fixing' or if that
> > is indeed the desired behaviour.
>
> I don't mind fixing bugs as long as there a clear testcase, but I think it
> would be a mistake to start special-casing injected arrays vs collections.
>
> > I'll see if I can get <msgSets/> to pass parsing, as that should also
> work.
> >
> > -Chris
> >
> >
> >
> > On Tue, May 7, 2013 at 1:25 PM, Stuart McCulloch <mc...@gmail.com>
> wrote:
> >
> >> Actually I think it might be a side-effect of the following
> >> feature/improvement made for M3:
> >>
> >>        https://issues.sonatype.org/browse/SISU-58
> >>
> >> where the code to handle arrays was made more consistent wrt. the
> handling
> >> of collections.
> >>
> >> On 6 May 2013, at 12:35, Hervé BOUTEMY wrote:
> >>
> >>> looks like a subtle change in injection when moving from Plexus to
> Guice
> >>>
> >>> Regards,
> >>>
> >>> Hervé
> >>>
> >>> Le lundi 6 mai 2013 23:06:49 Chris Graham a écrit :
> >>>> Hey All.
> >>>>
> >>>> I'm not sure if I've found a regression issue with Maven 3.0.x (tried
> >> with
> >>>> all versions beta-1 onwards to 3.0.5) or not. V3.x behaves differently
> >> to
> >>>> 2.09, 2.0.11 and 2.2.1.
> >>>>
> >>>> I've written a plugin for WebSphere Message Broker; basically it's a
> >>>> wrapper for the underlying mqsicreatebar tool.
> >>>>
> >>>> Amongst other things, it takes zero or more message sets and message
> >> flows.
> >>>> To handle this, I defined the parameters as an array.
> >>>>
> >>>> Here is the snippet from the plugin's source:
> >>>>   /**
> >>>>    * The message flows to be added to the bar file.
> >>>>    * @parameter expression="${msgFlows}"
> >>>>    * @required
> >>>>    */
> >>>>   private String[] msgFlows;
> >>>>
> >>>>   /**
> >>>>    * The message sets to be added to the bar file.
> >>>>    * @parameter expression="${msgSets}"
> >>>>    * @required
> >>>>    */
> >>>>   private String[] msgSets;
> >>>>
> >>>> and here is an example configuration section from a pom that uses the
> >>>> plugin:
> >>>>
> >>>>               <configuration>
> >>>>                   <skipApplyOverrides>false</skipApplyOverrides>
> >>>>                   <isV60>true</isV60>
> >>>>                   <workspace>${wmbtk.workspace.root}/24a</workspace>
> >>>>                   <msgFlows>
> >>>>
> >>>> <msgFlow>MFP_Project/com/blah/MFL_DiagFlow.msgflow</msgFlow>
> >>>>                   </msgFlows>
> >>>>                   <msgSets>
> >>>>                       <msgSet />
> >>>>                   </msgSets>
> >>>>               </configuration>
> >>>>
> >>>> So we have one message flow, but no message sets.
> >>>>
> >>>> Here is where the differences are seen.
> >>>>
> >>>> Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.
> >>>>
> >>>> Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single
> element
> >> of
> >>>> null.
> >>>>
> >>>> My question boils down to: is this the desired behaviour?
> >>>>
> >>>> I've had to adjust my code to work under Maven 3.x (which I didn't
> think
> >>>> that I had too).
> >>>>
> >>>> From memory, I can not supply an empty <msgSets/> element (but I need
> to
> >>>> check that).
> >>>>
> >>>> -Chris
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: dev-help@maven.apache.org
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Regression? Plugin Parameter Injection

Posted by Stuart McCulloch <mc...@gmail.com>.
On 6 May 2013, at 23:49, Chris Graham wrote:

> Looking at that issue, if the issue was meant to deal with the example
> given, ie, and array of strings, then the issue is most certainly not
> fixed, as it is my exact case.

The issue addressed making the behaviour more consistent, which it does - iirc the same XML configuration injected into a list would give a list with one element, so for the array case I'd expect a one element array.

> Either way, as that behaviour is in published versions, my plugin needs to
> be able to deal with both cases.
> 
> From my example,
>                    <msgSets>
>                        <msgSet />
>                    </msgSets>
> 
> 
> It is giving me precisely what the pom says. An arrary, of one null element.
> 
> It just surprised me that the behaviour changed when compared to 2.x. Were
> I got a null array.

Various undefined or inconsistent behaviour was cleaned up and made consistent rather than carry-over broken/odd behaviour.

> it's really up to you guys to decide if it's a) worth 'fixing' or if that
> is indeed the desired behaviour.

I don't mind fixing bugs as long as there a clear testcase, but I think it would be a mistake to start special-casing injected arrays vs collections. 

> I'll see if I can get <msgSets/> to pass parsing, as that should also work.
> 
> -Chris
> 
> 
> 
> On Tue, May 7, 2013 at 1:25 PM, Stuart McCulloch <mc...@gmail.com> wrote:
> 
>> Actually I think it might be a side-effect of the following
>> feature/improvement made for M3:
>> 
>>        https://issues.sonatype.org/browse/SISU-58
>> 
>> where the code to handle arrays was made more consistent wrt. the handling
>> of collections.
>> 
>> On 6 May 2013, at 12:35, Hervé BOUTEMY wrote:
>> 
>>> looks like a subtle change in injection when moving from Plexus to Guice
>>> 
>>> Regards,
>>> 
>>> Hervé
>>> 
>>> Le lundi 6 mai 2013 23:06:49 Chris Graham a écrit :
>>>> Hey All.
>>>> 
>>>> I'm not sure if I've found a regression issue with Maven 3.0.x (tried
>> with
>>>> all versions beta-1 onwards to 3.0.5) or not. V3.x behaves differently
>> to
>>>> 2.09, 2.0.11 and 2.2.1.
>>>> 
>>>> I've written a plugin for WebSphere Message Broker; basically it's a
>>>> wrapper for the underlying mqsicreatebar tool.
>>>> 
>>>> Amongst other things, it takes zero or more message sets and message
>> flows.
>>>> To handle this, I defined the parameters as an array.
>>>> 
>>>> Here is the snippet from the plugin's source:
>>>>   /**
>>>>    * The message flows to be added to the bar file.
>>>>    * @parameter expression="${msgFlows}"
>>>>    * @required
>>>>    */
>>>>   private String[] msgFlows;
>>>> 
>>>>   /**
>>>>    * The message sets to be added to the bar file.
>>>>    * @parameter expression="${msgSets}"
>>>>    * @required
>>>>    */
>>>>   private String[] msgSets;
>>>> 
>>>> and here is an example configuration section from a pom that uses the
>>>> plugin:
>>>> 
>>>>               <configuration>
>>>>                   <skipApplyOverrides>false</skipApplyOverrides>
>>>>                   <isV60>true</isV60>
>>>>                   <workspace>${wmbtk.workspace.root}/24a</workspace>
>>>>                   <msgFlows>
>>>> 
>>>> <msgFlow>MFP_Project/com/blah/MFL_DiagFlow.msgflow</msgFlow>
>>>>                   </msgFlows>
>>>>                   <msgSets>
>>>>                       <msgSet />
>>>>                   </msgSets>
>>>>               </configuration>
>>>> 
>>>> So we have one message flow, but no message sets.
>>>> 
>>>> Here is where the differences are seen.
>>>> 
>>>> Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.
>>>> 
>>>> Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single element
>> of
>>>> null.
>>>> 
>>>> My question boils down to: is this the desired behaviour?
>>>> 
>>>> I've had to adjust my code to work under Maven 3.x (which I didn't think
>>>> that I had too).
>>>> 
>>>> From memory, I can not supply an empty <msgSets/> element (but I need to
>>>> check that).
>>>> 
>>>> -Chris
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Regression? Plugin Parameter Injection

Posted by Chris Graham <ch...@gmail.com>.
The other part of the problem, and this is what originally got my
attention, is that the parameter is marked as required.

It is not being supplied in the pom.

2.0.9 correctly detects this with the following error:

[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] One or more required plugin parameters are invalid/missing for
'message-broker:package-bar-file'

[0] Inside the definition for plugin 'maven-message-broker-plugin' specify
the following:

<configuration>
  ...
  <msgFlows>VALUE</msgFlows>
</configuration>

-OR-

on the command line, specify: '-DmsgFlows=VALUE'

[1] Inside the definition for plugin 'maven-message-broker-plugin' specify
the following:

<configuration>
  ...
  <msgSets>VALUE</msgSets>
</configuration>

-OR-

on the command line, specify: '-DmsgSets=VALUE'


However, maven 3.x does not enforce the @required.

IMHO, it should.

-Chris

PS: Sadly, <msgSets/> does not work either under 2.0.9. I needs to be

<msgSets>
  <msgSet/>
</msgSets>

etc



On Tue, May 7, 2013 at 1:49 PM, Chris Graham <ch...@gmail.com> wrote:

> Looking at that issue, if the issue was meant to deal with the example
> given, ie, and array of strings, then the issue is most certainly not
> fixed, as it is my exact case.
>
> Either way, as that behaviour is in published versions, my plugin needs to
> be able to deal with both cases.
>
> From my example,
>                     <msgSets>
>                         <msgSet />
>                     </msgSets>
>
>
> It is giving me precisely what the pom says. An arrary, of one null
> element.
>
> It just surprised me that the behaviour changed when compared to 2.x. Were
> I got a null array.
>
> it's really up to you guys to decide if it's a) worth 'fixing' or if that
> is indeed the desired behaviour.
>
> I'll see if I can get <msgSets/> to pass parsing, as that should also work.
>
> -Chris
>
>
>
> On Tue, May 7, 2013 at 1:25 PM, Stuart McCulloch <mc...@gmail.com>wrote:
>
>> Actually I think it might be a side-effect of the following
>> feature/improvement made for M3:
>>
>>         https://issues.sonatype.org/browse/SISU-58
>>
>> where the code to handle arrays was made more consistent wrt. the
>> handling of collections.
>>
>> On 6 May 2013, at 12:35, Hervé BOUTEMY wrote:
>>
>> > looks like a subtle change in injection when moving from Plexus to Guice
>> >
>> > Regards,
>> >
>> > Hervé
>> >
>> > Le lundi 6 mai 2013 23:06:49 Chris Graham a écrit :
>> >> Hey All.
>> >>
>> >> I'm not sure if I've found a regression issue with Maven 3.0.x (tried
>> with
>> >> all versions beta-1 onwards to 3.0.5) or not. V3.x behaves differently
>> to
>> >> 2.09, 2.0.11 and 2.2.1.
>> >>
>> >> I've written a plugin for WebSphere Message Broker; basically it's a
>> >> wrapper for the underlying mqsicreatebar tool.
>> >>
>> >> Amongst other things, it takes zero or more message sets and message
>> flows.
>> >> To handle this, I defined the parameters as an array.
>> >>
>> >> Here is the snippet from the plugin's source:
>> >>    /**
>> >>     * The message flows to be added to the bar file.
>> >>     * @parameter expression="${msgFlows}"
>> >>     * @required
>> >>     */
>> >>    private String[] msgFlows;
>> >>
>> >>    /**
>> >>     * The message sets to be added to the bar file.
>> >>     * @parameter expression="${msgSets}"
>> >>     * @required
>> >>     */
>> >>    private String[] msgSets;
>> >>
>> >> and here is an example configuration section from a pom that uses the
>> >> plugin:
>> >>
>> >>                <configuration>
>> >>                    <skipApplyOverrides>false</skipApplyOverrides>
>> >>                    <isV60>true</isV60>
>> >>                    <workspace>${wmbtk.workspace.root}/24a</workspace>
>> >>                    <msgFlows>
>> >>
>> >> <msgFlow>MFP_Project/com/blah/MFL_DiagFlow.msgflow</msgFlow>
>> >>                    </msgFlows>
>> >>                    <msgSets>
>> >>                        <msgSet />
>> >>                    </msgSets>
>> >>                </configuration>
>> >>
>> >> So we have one message flow, but no message sets.
>> >>
>> >> Here is where the differences are seen.
>> >>
>> >> Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.
>> >>
>> >> Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single
>> element of
>> >> null.
>> >>
>> >> My question boils down to: is this the desired behaviour?
>> >>
>> >> I've had to adjust my code to work under Maven 3.x (which I didn't
>> think
>> >> that I had too).
>> >>
>> >> From memory, I can not supply an empty <msgSets/> element (but I need
>> to
>> >> check that).
>> >>
>> >> -Chris
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: dev-help@maven.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>

Re: Regression? Plugin Parameter Injection

Posted by Chris Graham <ch...@gmail.com>.
Looking at that issue, if the issue was meant to deal with the example
given, ie, and array of strings, then the issue is most certainly not
fixed, as it is my exact case.

Either way, as that behaviour is in published versions, my plugin needs to
be able to deal with both cases.

>From my example,
                    <msgSets>
                        <msgSet />
                    </msgSets>


It is giving me precisely what the pom says. An arrary, of one null element.

It just surprised me that the behaviour changed when compared to 2.x. Were
I got a null array.

it's really up to you guys to decide if it's a) worth 'fixing' or if that
is indeed the desired behaviour.

I'll see if I can get <msgSets/> to pass parsing, as that should also work.

-Chris



On Tue, May 7, 2013 at 1:25 PM, Stuart McCulloch <mc...@gmail.com> wrote:

> Actually I think it might be a side-effect of the following
> feature/improvement made for M3:
>
>         https://issues.sonatype.org/browse/SISU-58
>
> where the code to handle arrays was made more consistent wrt. the handling
> of collections.
>
> On 6 May 2013, at 12:35, Hervé BOUTEMY wrote:
>
> > looks like a subtle change in injection when moving from Plexus to Guice
> >
> > Regards,
> >
> > Hervé
> >
> > Le lundi 6 mai 2013 23:06:49 Chris Graham a écrit :
> >> Hey All.
> >>
> >> I'm not sure if I've found a regression issue with Maven 3.0.x (tried
> with
> >> all versions beta-1 onwards to 3.0.5) or not. V3.x behaves differently
> to
> >> 2.09, 2.0.11 and 2.2.1.
> >>
> >> I've written a plugin for WebSphere Message Broker; basically it's a
> >> wrapper for the underlying mqsicreatebar tool.
> >>
> >> Amongst other things, it takes zero or more message sets and message
> flows.
> >> To handle this, I defined the parameters as an array.
> >>
> >> Here is the snippet from the plugin's source:
> >>    /**
> >>     * The message flows to be added to the bar file.
> >>     * @parameter expression="${msgFlows}"
> >>     * @required
> >>     */
> >>    private String[] msgFlows;
> >>
> >>    /**
> >>     * The message sets to be added to the bar file.
> >>     * @parameter expression="${msgSets}"
> >>     * @required
> >>     */
> >>    private String[] msgSets;
> >>
> >> and here is an example configuration section from a pom that uses the
> >> plugin:
> >>
> >>                <configuration>
> >>                    <skipApplyOverrides>false</skipApplyOverrides>
> >>                    <isV60>true</isV60>
> >>                    <workspace>${wmbtk.workspace.root}/24a</workspace>
> >>                    <msgFlows>
> >>
> >> <msgFlow>MFP_Project/com/blah/MFL_DiagFlow.msgflow</msgFlow>
> >>                    </msgFlows>
> >>                    <msgSets>
> >>                        <msgSet />
> >>                    </msgSets>
> >>                </configuration>
> >>
> >> So we have one message flow, but no message sets.
> >>
> >> Here is where the differences are seen.
> >>
> >> Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.
> >>
> >> Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single element
> of
> >> null.
> >>
> >> My question boils down to: is this the desired behaviour?
> >>
> >> I've had to adjust my code to work under Maven 3.x (which I didn't think
> >> that I had too).
> >>
> >> From memory, I can not supply an empty <msgSets/> element (but I need to
> >> check that).
> >>
> >> -Chris
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Regression? Plugin Parameter Injection

Posted by Stuart McCulloch <mc...@gmail.com>.
Actually I think it might be a side-effect of the following feature/improvement made for M3:

	https://issues.sonatype.org/browse/SISU-58

where the code to handle arrays was made more consistent wrt. the handling of collections.

On 6 May 2013, at 12:35, Hervé BOUTEMY wrote:

> looks like a subtle change in injection when moving from Plexus to Guice
> 
> Regards,
> 
> Hervé
> 
> Le lundi 6 mai 2013 23:06:49 Chris Graham a écrit :
>> Hey All.
>> 
>> I'm not sure if I've found a regression issue with Maven 3.0.x (tried with
>> all versions beta-1 onwards to 3.0.5) or not. V3.x behaves differently to
>> 2.09, 2.0.11 and 2.2.1.
>> 
>> I've written a plugin for WebSphere Message Broker; basically it's a
>> wrapper for the underlying mqsicreatebar tool.
>> 
>> Amongst other things, it takes zero or more message sets and message flows.
>> To handle this, I defined the parameters as an array.
>> 
>> Here is the snippet from the plugin's source:
>>    /**
>>     * The message flows to be added to the bar file.
>>     * @parameter expression="${msgFlows}"
>>     * @required
>>     */
>>    private String[] msgFlows;
>> 
>>    /**
>>     * The message sets to be added to the bar file.
>>     * @parameter expression="${msgSets}"
>>     * @required
>>     */
>>    private String[] msgSets;
>> 
>> and here is an example configuration section from a pom that uses the
>> plugin:
>> 
>>                <configuration>
>>                    <skipApplyOverrides>false</skipApplyOverrides>
>>                    <isV60>true</isV60>
>>                    <workspace>${wmbtk.workspace.root}/24a</workspace>
>>                    <msgFlows>
>> 
>> <msgFlow>MFP_Project/com/blah/MFL_DiagFlow.msgflow</msgFlow>
>>                    </msgFlows>
>>                    <msgSets>
>>                        <msgSet />
>>                    </msgSets>
>>                </configuration>
>> 
>> So we have one message flow, but no message sets.
>> 
>> Here is where the differences are seen.
>> 
>> Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.
>> 
>> Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single element of
>> null.
>> 
>> My question boils down to: is this the desired behaviour?
>> 
>> I've had to adjust my code to work under Maven 3.x (which I didn't think
>> that I had too).
>> 
>> From memory, I can not supply an empty <msgSets/> element (but I need to
>> check that).
>> 
>> -Chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Regression? Plugin Parameter Injection

Posted by Chris Graham <ch...@gmail.com>.
There are not too many examples of arrays as injected parameters (I looked
when I wrote this a few years back, and I'm not sure if I found any).

Are there any IT's in the core that test/work with arrays?

-Chris


On Tue, May 7, 2013 at 2:42 AM, Robert Scholte <rf...@apache.org> wrote:

> I consider it as an improvement.
> With M3 you have more control over null- Lists and empty Lists.
>
> Robert
>
> Op Mon, 06 May 2013 18:35:24 +0200 schreef Hervé BOUTEMY <
> herve.boutemy@free.fr>:
>
>
>  looks like a subtle change in injection when moving from Plexus to Guice
>>
>> Regards,
>>
>> Hervé
>>
>> Le lundi 6 mai 2013 23:06:49 Chris Graham a écrit :
>>
>>> Hey All.
>>>
>>> I'm not sure if I've found a regression issue with Maven 3.0.x (tried
>>> with
>>> all versions beta-1 onwards to 3.0.5) or not. V3.x behaves differently to
>>> 2.09, 2.0.11 and 2.2.1.
>>>
>>> I've written a plugin for WebSphere Message Broker; basically it's a
>>> wrapper for the underlying mqsicreatebar tool.
>>>
>>> Amongst other things, it takes zero or more message sets and message
>>> flows.
>>> To handle this, I defined the parameters as an array.
>>>
>>> Here is the snippet from the plugin's source:
>>>     /**
>>>      * The message flows to be added to the bar file.
>>>      * @parameter expression="${msgFlows}"
>>>      * @required
>>>      */
>>>     private String[] msgFlows;
>>>
>>>     /**
>>>      * The message sets to be added to the bar file.
>>>      * @parameter expression="${msgSets}"
>>>      * @required
>>>      */
>>>     private String[] msgSets;
>>>
>>> and here is an example configuration section from a pom that uses the
>>> plugin:
>>>
>>>                 <configuration>
>>>                     <skipApplyOverrides>false</**skipApplyOverrides>
>>>                     <isV60>true</isV60>
>>>                     <workspace>${wmbtk.workspace.**root}/24a</workspace>
>>>                     <msgFlows>
>>>
>>> <msgFlow>MFP_Project/com/blah/**MFL_DiagFlow.msgflow</msgFlow>
>>>                     </msgFlows>
>>>                     <msgSets>
>>>                         <msgSet />
>>>                     </msgSets>
>>>                 </configuration>
>>>
>>> So we have one message flow, but no message sets.
>>>
>>> Here is where the differences are seen.
>>>
>>> Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.
>>>
>>> Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single element
>>> of
>>> null.
>>>
>>> My question boils down to: is this the desired behaviour?
>>>
>>> I've had to adjust my code to work under Maven 3.x (which I didn't think
>>> that I had too).
>>>
>>> From memory, I can not supply an empty <msgSets/> element (but I need to
>>> check that).
>>>
>>> -Chris
>>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.**org<de...@maven.apache.org>
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.**org<de...@maven.apache.org>
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Regression? Plugin Parameter Injection

Posted by Robert Scholte <rf...@apache.org>.
I consider it as an improvement.
With M3 you have more control over null- Lists and empty Lists.

Robert

Op Mon, 06 May 2013 18:35:24 +0200 schreef Hervé BOUTEMY  
<he...@free.fr>:

> looks like a subtle change in injection when moving from Plexus to Guice
>
> Regards,
>
> Hervé
>
> Le lundi 6 mai 2013 23:06:49 Chris Graham a écrit :
>> Hey All.
>>
>> I'm not sure if I've found a regression issue with Maven 3.0.x (tried  
>> with
>> all versions beta-1 onwards to 3.0.5) or not. V3.x behaves differently  
>> to
>> 2.09, 2.0.11 and 2.2.1.
>>
>> I've written a plugin for WebSphere Message Broker; basically it's a
>> wrapper for the underlying mqsicreatebar tool.
>>
>> Amongst other things, it takes zero or more message sets and message  
>> flows.
>> To handle this, I defined the parameters as an array.
>>
>> Here is the snippet from the plugin's source:
>>     /**
>>      * The message flows to be added to the bar file.
>>      * @parameter expression="${msgFlows}"
>>      * @required
>>      */
>>     private String[] msgFlows;
>>
>>     /**
>>      * The message sets to be added to the bar file.
>>      * @parameter expression="${msgSets}"
>>      * @required
>>      */
>>     private String[] msgSets;
>>
>> and here is an example configuration section from a pom that uses the
>> plugin:
>>
>>                 <configuration>
>>                     <skipApplyOverrides>false</skipApplyOverrides>
>>                     <isV60>true</isV60>
>>                     <workspace>${wmbtk.workspace.root}/24a</workspace>
>>                     <msgFlows>
>>
>> <msgFlow>MFP_Project/com/blah/MFL_DiagFlow.msgflow</msgFlow>
>>                     </msgFlows>
>>                     <msgSets>
>>                         <msgSet />
>>                     </msgSets>
>>                 </configuration>
>>
>> So we have one message flow, but no message sets.
>>
>> Here is where the differences are seen.
>>
>> Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.
>>
>> Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single element  
>> of
>> null.
>>
>> My question boils down to: is this the desired behaviour?
>>
>> I've had to adjust my code to work under Maven 3.x (which I didn't think
>> that I had too).
>>
>> From memory, I can not supply an empty <msgSets/> element (but I need to
>> check that).
>>
>> -Chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Regression? Plugin Parameter Injection

Posted by Hervé BOUTEMY <he...@free.fr>.
looks like a subtle change in injection when moving from Plexus to Guice

Regards,

Hervé

Le lundi 6 mai 2013 23:06:49 Chris Graham a écrit :
> Hey All.
> 
> I'm not sure if I've found a regression issue with Maven 3.0.x (tried with
> all versions beta-1 onwards to 3.0.5) or not. V3.x behaves differently to
> 2.09, 2.0.11 and 2.2.1.
> 
> I've written a plugin for WebSphere Message Broker; basically it's a
> wrapper for the underlying mqsicreatebar tool.
> 
> Amongst other things, it takes zero or more message sets and message flows.
> To handle this, I defined the parameters as an array.
> 
> Here is the snippet from the plugin's source:
>     /**
>      * The message flows to be added to the bar file.
>      * @parameter expression="${msgFlows}"
>      * @required
>      */
>     private String[] msgFlows;
> 
>     /**
>      * The message sets to be added to the bar file.
>      * @parameter expression="${msgSets}"
>      * @required
>      */
>     private String[] msgSets;
> 
> and here is an example configuration section from a pom that uses the
> plugin:
> 
>                 <configuration>
>                     <skipApplyOverrides>false</skipApplyOverrides>
>                     <isV60>true</isV60>
>                     <workspace>${wmbtk.workspace.root}/24a</workspace>
>                     <msgFlows>
> 
> <msgFlow>MFP_Project/com/blah/MFL_DiagFlow.msgflow</msgFlow>
>                     </msgFlows>
>                     <msgSets>
>                         <msgSet />
>                     </msgSets>
>                 </configuration>
> 
> So we have one message flow, but no message sets.
> 
> Here is where the differences are seen.
> 
> Maven 2.0.9, 2.0.11 and 2.2.1 will initialise the msgSets as null.
> 
> Maven 3.0 (beta-1 to 3.0.5) will initialise msgSets as a single element of
> null.
> 
> My question boils down to: is this the desired behaviour?
> 
> I've had to adjust my code to work under Maven 3.x (which I didn't think
> that I had too).
> 
> From memory, I can not supply an empty <msgSets/> element (but I need to
> check that).
> 
> -Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org