maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Graham <chrisgw...@gmail.com>
Subject Re: Regression? Plugin Parameter Injection
Date Tue, 07 May 2013 03:57:38 GMT
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 <chrisgwarp@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 <mcculls@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
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message