You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "S. Ali Tokmen" <no...@alishomepage.com> on 2014/01/07 19:38:17 UTC

Maven2/Maven3 plugin development: Ensuring only the available parameters are allowed

Dear Maven users

I am one of the owners of Codehaus CARGO, which has a Maven2/Maven3
plugin; and would have a question with regards to how parameters are
managed.

We defined our MOJOs with parameters (you can see
http://svn.codehaus.org/cargo/extensions/trunk/maven2/plugin/src/main/java/org/codehaus/cargo/maven2/AbstractCargoMojo.java
for example), but what happens is that if a user unwillingly puts a
parameter in the wrong place then the plugin execution doesn't stop.

As an example, I can write the below POM and build still works (even
thought the MOJO has no parameter called "foo"):

  <plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.4.6</version>
    <configuration>
      <foo>
        bar
      </foo>
    </configuration>
  </plugin>

Is there any way I can instruct by MOJO to fail if there is an unknown
parameter?

Please advise

Thank you

-- 

S. Ali Tokmen
http://ali.tokmen.com/

My IM, GSM, PGP and other contact details
are on http://contact.ali.tokmen.com


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


Re: Maven2/Maven3 plugin development: Ensuring only the available parameters are allowed

Posted by Thomas Broyer <t....@gmail.com>.
Isn't that simply because the <configuration> is shared by all goals? (or
all goals of the parent <execution>)


On Tue, Jan 7, 2014 at 7:38 PM, S. Ali Tokmen <no...@alishomepage.com>wrote:

> Dear Maven users
>
> I am one of the owners of Codehaus CARGO, which has a Maven2/Maven3
> plugin; and would have a question with regards to how parameters are
> managed.
>
> We defined our MOJOs with parameters (you can see
>
> http://svn.codehaus.org/cargo/extensions/trunk/maven2/plugin/src/main/java/org/codehaus/cargo/maven2/AbstractCargoMojo.java
> for example), but what happens is that if a user unwillingly puts a
> parameter in the wrong place then the plugin execution doesn't stop.
>
> As an example, I can write the below POM and build still works (even
> thought the MOJO has no parameter called "foo"):
>
>   <plugin>
>     <groupId>org.codehaus.cargo</groupId>
>     <artifactId>cargo-maven2-plugin</artifactId>
>     <version>1.4.6</version>
>     <configuration>
>       <foo>
>         bar
>       </foo>
>     </configuration>
>   </plugin>
>
> Is there any way I can instruct by MOJO to fail if there is an unknown
> parameter?
>
> Please advise
>
> Thank you
>
> --
>
> S. Ali Tokmen
> http://ali.tokmen.com/
>
> My IM, GSM, PGP and other contact details
> are on http://contact.ali.tokmen.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Thomas Broyer
/tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/>

Re: Maven2/Maven3 plugin development: Ensuring only the available parameters are allowed

Posted by Stephen Connolly <st...@gmail.com>.
There are valid reasons why a configuration having "invalid" elements may
be "valid".

Consider the case where
xpath:/project/build/pluginManagement/plugins/plugin/version specifies the
*default* version and xpath:/project/build/plugins/plugin/version is
absent... In this case xpath:/project/build/plugins/plugin/configuration
applies to any version of the plugin, so somebody invoking a specific
version of the plugin directly would/should get that configuration... Thus
an element that does not make sense to the executing version of the plugin
*may* make sense to a future/older version if the plugin... Hence failing
because of unknown parameters would be a "bad thing"

You could request the dom node yourself and parse it by hand if you want to
issue warning though

On Tuesday, 7 January 2014, S. Ali Tokmen wrote:

> Dear Maven users
>
> I am one of the owners of Codehaus CARGO, which has a Maven2/Maven3
> plugin; and would have a question with regards to how parameters are
> managed.
>
> We defined our MOJOs with parameters (you can see
>
> http://svn.codehaus.org/cargo/extensions/trunk/maven2/plugin/src/main/java/org/codehaus/cargo/maven2/AbstractCargoMojo.java
> for example), but what happens is that if a user unwillingly puts a
> parameter in the wrong place then the plugin execution doesn't stop.
>
> As an example, I can write the below POM and build still works (even
> thought the MOJO has no parameter called "foo"):
>
>   <plugin>
>     <groupId>org.codehaus.cargo</groupId>
>     <artifactId>cargo-maven2-plugin</artifactId>
>     <version>1.4.6</version>
>     <configuration>
>       <foo>
>         bar
>       </foo>
>     </configuration>
>   </plugin>
>
> Is there any way I can instruct by MOJO to fail if there is an unknown
> parameter?
>
> Please advise
>
> Thank you
>
> --
>
> S. Ali Tokmen
> http://ali.tokmen.com/
>
> My IM, GSM, PGP and other contact details
> are on http://contact.ali.tokmen.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org <javascript:;>
> For additional commands, e-mail: users-help@maven.apache.org<javascript:;>
>
>

-- 
Sent from my phone

Re: Maven2/Maven3 plugin development: Ensuring only the available parameters are allowed

Posted by "S. Ali Tokmen" <no...@alishomepage.com>.
Hi Anders

Great, sounds good. I've opened
https://jira.codehaus.org/browse/MNG-5563 for it.

Have a great day

S. Ali Tokmen
http://ali.tokmen.com/

My IM, GSM, PGP and other contact details
are on http://contact.ali.tokmen.com

On 15/01/14 20:48, Anders Hammar wrote:
> It doesn't work with the way Maven plugins currently are configured.
> But there will soon be discussions around a new version of the pom, so you
> could file a ticket to get this wish on the board.
>
> /Anders (mobile)
> Den 15 jan 2014 19:22 skrev "S. Ali Tokmen" <no...@alishomepage.com>:
>
>> Hi Andreas
>>
>> You are right - this makes a lot of sense.
>>
>> Shall I still raise a JIRA entry for this functionality; or is this
>> close to impossible to implement?
>>
>> Thank you
>>
>> S. Ali Tokmen
>> http://ali.tokmen.com/
>>
>> My IM, GSM, PGP and other contact details
>> are on http://contact.ali.tokmen.com
>>
>> On 14/01/14 21:16, Anders Hammar wrote:
>>> Don't think that's doable as the user could configure the params for
>>> different goals in the same configuration section (on plugin level, not
>>> execution level).
>>>
>>> /Anders
>>>
>>>
>>> On Tue, Jan 14, 2014 at 7:38 PM, S. Ali Tokmen <nospam@alishomepage.com
>>> wrote:
>>>
>>>> Hi Baptiste, Thomas
>>>>
>>>> I guess you all got a point :) The reason why I want to check the
>>>> configuration is indeed something that would have to be done in each
>> goal.
>>>> My remaining question would be whether there is a way to read the
>>>> <configuration> XML definition from the MOJO - I could then manually
>>>> implement such a verification in the different MOJOs.
>>>>
>>>> Please advise
>>>>
>>>> Thank you
>>>>
>>>> S. Ali Tokmen
>>>> http://ali.tokmen.com/
>>>>
>>>> My IM, GSM, PGP and other contact details
>>>> are on http://contact.ali.tokmen.com
>>>>
>>>> On 14/01/14 14:24, Baptiste Mathus wrote:
>>>>> Hi,
>>>>> Stephen already answered along those lines. What are you missing?
>>>>> Cheers
>>>>>
>>>>>
>>>>> 2014/1/9 S. Ali Tokmen <no...@alishomepage.com>
>>>>>
>>>>>> Hi Anders
>>>>>>
>>>>>> Thanks for your reply - and happy new year :)
>>>>>>
>>>>>> Is there any way I can inject / read the whole plugin configuration
>> from
>>>>>> the plugin?
>>>>>>
>>>>>> Best regards
>>>>>>
>>>>>> S. Ali Tokmen
>>>>>> http://ali.tokmen.com/
>>>>>>
>>>>>> My IM, GSM, PGP and other contact details
>>>>>> are on http://contact.ali.tokmen.com
>>>>>>
>>>>>> On 08/01/14 20:00, Anders Hammar wrote:
>>>>>>> AFAIK there is no support for this. If you think there should be,
>>>> please
>>>>>>> file a ticket [1].
>>>>>>>
>>>>>>> /Anders
>>>>>>>
>>>>>>> [1] http://jira.codehaus.org/browse/MNG/
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Jan 7, 2014 at 7:38 PM, S. Ali Tokmen <
>> nospam@alishomepage.com
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Dear Maven users
>>>>>>>>
>>>>>>>> I am one of the owners of Codehaus CARGO, which has a Maven2/Maven3
>>>>>>>> plugin; and would have a question with regards to how parameters are
>>>>>>>> managed.
>>>>>>>>
>>>>>>>> We defined our MOJOs with parameters (you can see
>>>>>>>>
>>>>>>>>
>> http://svn.codehaus.org/cargo/extensions/trunk/maven2/plugin/src/main/java/org/codehaus/cargo/maven2/AbstractCargoMojo.java
>>>>>>>> for example), but what happens is that if a user unwillingly puts a
>>>>>>>> parameter in the wrong place then the plugin execution doesn't stop.
>>>>>>>>
>>>>>>>> As an example, I can write the below POM and build still works (even
>>>>>>>> thought the MOJO has no parameter called "foo"):
>>>>>>>>
>>>>>>>>   <plugin>
>>>>>>>>     <groupId>org.codehaus.cargo</groupId>
>>>>>>>>     <artifactId>cargo-maven2-plugin</artifactId>
>>>>>>>>     <version>1.4.6</version>
>>>>>>>>     <configuration>
>>>>>>>>       <foo>
>>>>>>>>         bar
>>>>>>>>       </foo>
>>>>>>>>     </configuration>
>>>>>>>>   </plugin>
>>>>>>>>
>>>>>>>> Is there any way I can instruct by MOJO to fail if there is an
>> unknown
>>>>>>>> parameter?
>>>>>>>>
>>>>>>>> Please advise
>>>>>>>>
>>>>>>>> Thank you
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> S. Ali Tokmen
>>>>>>>> http://ali.tokmen.com/
>>>>>>>>
>>>>>>>> My IM, GSM, PGP and other contact details
>>>>>>>> are on http://contact.ali.tokmen.com
>>>>>>>>
>>>>>>>>
>>>>>>>>
>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>
>>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>
>>>>>> --
>>>>>> Baptiste <Batmat> MATHUS - http://batmat.net
>>>>>> Sauvez un arbre,
>>>>>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>


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


Re: Maven2/Maven3 plugin development: Ensuring only the available parameters are allowed

Posted by Al...@miranda.com.
If you do open a ticket, please let me/us know. I will +1 it. I am also 
interested in this feature

Alejandro Endo | Software Designer/Concepteur de logiciels



From:   Anders Hammar <an...@hammar.net>
To:     Maven Users List <us...@maven.apache.org>, 
Date:   2014-01-15 02:47 PM
Subject:        Re: Maven2/Maven3 plugin development: Ensuring only the 
available parameters are allowed
Sent by:        anders.g.hammar@gmail.com



It doesn't work with the way Maven plugins currently are configured.
But there will soon be discussions around a new version of the pom, so you
could file a ticket to get this wish on the board.

/Anders (mobile)
Den 15 jan 2014 19:22 skrev "S. Ali Tokmen" <no...@alishomepage.com>:

> Hi Andreas
>
> You are right - this makes a lot of sense.
>
> Shall I still raise a JIRA entry for this functionality; or is this
> close to impossible to implement?
>
> Thank you
>
> S. Ali Tokmen
> http://ali.tokmen.com/
>
> My IM, GSM, PGP and other contact details
> are on http://contact.ali.tokmen.com
>
> On 14/01/14 21:16, Anders Hammar wrote:
> > Don't think that's doable as the user could configure the params for
> > different goals in the same configuration section (on plugin level, 
not
> > execution level).
> >
> > /Anders
> >
> >
> > On Tue, Jan 14, 2014 at 7:38 PM, S. Ali Tokmen 
<nospam@alishomepage.com
> >wrote:
> >
> >> Hi Baptiste, Thomas
> >>
> >> I guess you all got a point :) The reason why I want to check the
> >> configuration is indeed something that would have to be done in each
> goal.
> >>
> >> My remaining question would be whether there is a way to read the
> >> <configuration> XML definition from the MOJO - I could then manually
> >> implement such a verification in the different MOJOs.
> >>
> >> Please advise
> >>
> >> Thank you
> >>
> >> S. Ali Tokmen
> >> http://ali.tokmen.com/
> >>
> >> My IM, GSM, PGP and other contact details
> >> are on http://contact.ali.tokmen.com
> >>
> >> On 14/01/14 14:24, Baptiste Mathus wrote:
> >>> Hi,
> >>> Stephen already answered along those lines. What are you missing?
> >>> Cheers
> >>>
> >>>
> >>> 2014/1/9 S. Ali Tokmen <no...@alishomepage.com>
> >>>
> >>>> Hi Anders
> >>>>
> >>>> Thanks for your reply - and happy new year :)
> >>>>
> >>>> Is there any way I can inject / read the whole plugin configuration
> from
> >>>> the plugin?
> >>>>
> >>>> Best regards
> >>>>
> >>>> S. Ali Tokmen
> >>>> http://ali.tokmen.com/
> >>>>
> >>>> My IM, GSM, PGP and other contact details
> >>>> are on http://contact.ali.tokmen.com
> >>>>
> >>>> On 08/01/14 20:00, Anders Hammar wrote:
> >>>>> AFAIK there is no support for this. If you think there should be,
> >> please
> >>>>> file a ticket [1].
> >>>>>
> >>>>> /Anders
> >>>>>
> >>>>> [1] http://jira.codehaus.org/browse/MNG/
> >>>>>
> >>>>>
> >>>>> On Tue, Jan 7, 2014 at 7:38 PM, S. Ali Tokmen <
> nospam@alishomepage.com
> >>>>> wrote:
> >>>>>
> >>>>>> Dear Maven users
> >>>>>>
> >>>>>> I am one of the owners of Codehaus CARGO, which has a 
Maven2/Maven3
> >>>>>> plugin; and would have a question with regards to how parameters 
are
> >>>>>> managed.
> >>>>>>
> >>>>>> We defined our MOJOs with parameters (you can see
> >>>>>>
> >>>>>>
> >>
> 
http://svn.codehaus.org/cargo/extensions/trunk/maven2/plugin/src/main/java/org/codehaus/cargo/maven2/AbstractCargoMojo.java

> >>>>>> for example), but what happens is that if a user unwillingly puts 
a
> >>>>>> parameter in the wrong place then the plugin execution doesn't 
stop.
> >>>>>>
> >>>>>> As an example, I can write the below POM and build still works 
(even
> >>>>>> thought the MOJO has no parameter called "foo"):
> >>>>>>
> >>>>>>   <plugin>
> >>>>>>     <groupId>org.codehaus.cargo</groupId>
> >>>>>>     <artifactId>cargo-maven2-plugin</artifactId>
> >>>>>>     <version>1.4.6</version>
> >>>>>>     <configuration>
> >>>>>>       <foo>
> >>>>>>         bar
> >>>>>>       </foo>
> >>>>>>     </configuration>
> >>>>>>   </plugin>
> >>>>>>
> >>>>>> Is there any way I can instruct by MOJO to fail if there is an
> unknown
> >>>>>> parameter?
> >>>>>>
> >>>>>> Please advise
> >>>>>>
> >>>>>> Thank you
> >>>>>>
> >>>>>> --
> >>>>>>
> >>>>>> S. Ali Tokmen
> >>>>>> http://ali.tokmen.com/
> >>>>>>
> >>>>>> My IM, GSM, PGP and other contact details
> >>>>>> are on http://contact.ali.tokmen.com
> >>>>>>
> >>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>>
> >>>>>>
> >>>> 
---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>
> >>>> --
> >>>> Baptiste <Batmat> MATHUS - http://batmat.net
> >>>> Sauvez un arbre,
> >>>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
> >>>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


DISCLAIMER:
Privileged and/or Confidential information may be contained in this
message. If you are not the addressee of this message, you may not
copy, use or deliver this message to anyone. In such event, you
should destroy the message and kindly notify the sender by reply
e-mail. It is understood that opinions or conclusions that do not
relate to the official business of the company are neither given
nor endorsed by the company.
Thank You.

Re: Maven2/Maven3 plugin development: Ensuring only the available parameters are allowed

Posted by Anders Hammar <an...@hammar.net>.
It doesn't work with the way Maven plugins currently are configured.
But there will soon be discussions around a new version of the pom, so you
could file a ticket to get this wish on the board.

/Anders (mobile)
Den 15 jan 2014 19:22 skrev "S. Ali Tokmen" <no...@alishomepage.com>:

> Hi Andreas
>
> You are right - this makes a lot of sense.
>
> Shall I still raise a JIRA entry for this functionality; or is this
> close to impossible to implement?
>
> Thank you
>
> S. Ali Tokmen
> http://ali.tokmen.com/
>
> My IM, GSM, PGP and other contact details
> are on http://contact.ali.tokmen.com
>
> On 14/01/14 21:16, Anders Hammar wrote:
> > Don't think that's doable as the user could configure the params for
> > different goals in the same configuration section (on plugin level, not
> > execution level).
> >
> > /Anders
> >
> >
> > On Tue, Jan 14, 2014 at 7:38 PM, S. Ali Tokmen <nospam@alishomepage.com
> >wrote:
> >
> >> Hi Baptiste, Thomas
> >>
> >> I guess you all got a point :) The reason why I want to check the
> >> configuration is indeed something that would have to be done in each
> goal.
> >>
> >> My remaining question would be whether there is a way to read the
> >> <configuration> XML definition from the MOJO - I could then manually
> >> implement such a verification in the different MOJOs.
> >>
> >> Please advise
> >>
> >> Thank you
> >>
> >> S. Ali Tokmen
> >> http://ali.tokmen.com/
> >>
> >> My IM, GSM, PGP and other contact details
> >> are on http://contact.ali.tokmen.com
> >>
> >> On 14/01/14 14:24, Baptiste Mathus wrote:
> >>> Hi,
> >>> Stephen already answered along those lines. What are you missing?
> >>> Cheers
> >>>
> >>>
> >>> 2014/1/9 S. Ali Tokmen <no...@alishomepage.com>
> >>>
> >>>> Hi Anders
> >>>>
> >>>> Thanks for your reply - and happy new year :)
> >>>>
> >>>> Is there any way I can inject / read the whole plugin configuration
> from
> >>>> the plugin?
> >>>>
> >>>> Best regards
> >>>>
> >>>> S. Ali Tokmen
> >>>> http://ali.tokmen.com/
> >>>>
> >>>> My IM, GSM, PGP and other contact details
> >>>> are on http://contact.ali.tokmen.com
> >>>>
> >>>> On 08/01/14 20:00, Anders Hammar wrote:
> >>>>> AFAIK there is no support for this. If you think there should be,
> >> please
> >>>>> file a ticket [1].
> >>>>>
> >>>>> /Anders
> >>>>>
> >>>>> [1] http://jira.codehaus.org/browse/MNG/
> >>>>>
> >>>>>
> >>>>> On Tue, Jan 7, 2014 at 7:38 PM, S. Ali Tokmen <
> nospam@alishomepage.com
> >>>>> wrote:
> >>>>>
> >>>>>> Dear Maven users
> >>>>>>
> >>>>>> I am one of the owners of Codehaus CARGO, which has a Maven2/Maven3
> >>>>>> plugin; and would have a question with regards to how parameters are
> >>>>>> managed.
> >>>>>>
> >>>>>> We defined our MOJOs with parameters (you can see
> >>>>>>
> >>>>>>
> >>
> http://svn.codehaus.org/cargo/extensions/trunk/maven2/plugin/src/main/java/org/codehaus/cargo/maven2/AbstractCargoMojo.java
> >>>>>> for example), but what happens is that if a user unwillingly puts a
> >>>>>> parameter in the wrong place then the plugin execution doesn't stop.
> >>>>>>
> >>>>>> As an example, I can write the below POM and build still works (even
> >>>>>> thought the MOJO has no parameter called "foo"):
> >>>>>>
> >>>>>>   <plugin>
> >>>>>>     <groupId>org.codehaus.cargo</groupId>
> >>>>>>     <artifactId>cargo-maven2-plugin</artifactId>
> >>>>>>     <version>1.4.6</version>
> >>>>>>     <configuration>
> >>>>>>       <foo>
> >>>>>>         bar
> >>>>>>       </foo>
> >>>>>>     </configuration>
> >>>>>>   </plugin>
> >>>>>>
> >>>>>> Is there any way I can instruct by MOJO to fail if there is an
> unknown
> >>>>>> parameter?
> >>>>>>
> >>>>>> Please advise
> >>>>>>
> >>>>>> Thank you
> >>>>>>
> >>>>>> --
> >>>>>>
> >>>>>> S. Ali Tokmen
> >>>>>> http://ali.tokmen.com/
> >>>>>>
> >>>>>> My IM, GSM, PGP and other contact details
> >>>>>> are on http://contact.ali.tokmen.com
> >>>>>>
> >>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>>
> >>>>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>
> >>>> --
> >>>> Baptiste <Batmat> MATHUS - http://batmat.net
> >>>> Sauvez un arbre,
> >>>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
> >>>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven2/Maven3 plugin development: Ensuring only the available parameters are allowed

Posted by "S. Ali Tokmen" <no...@alishomepage.com>.
Hi Andreas

You are right - this makes a lot of sense.

Shall I still raise a JIRA entry for this functionality; or is this
close to impossible to implement?

Thank you

S. Ali Tokmen
http://ali.tokmen.com/

My IM, GSM, PGP and other contact details
are on http://contact.ali.tokmen.com

On 14/01/14 21:16, Anders Hammar wrote:
> Don't think that's doable as the user could configure the params for
> different goals in the same configuration section (on plugin level, not
> execution level).
>
> /Anders
>
>
> On Tue, Jan 14, 2014 at 7:38 PM, S. Ali Tokmen <no...@alishomepage.com>wrote:
>
>> Hi Baptiste, Thomas
>>
>> I guess you all got a point :) The reason why I want to check the
>> configuration is indeed something that would have to be done in each goal.
>>
>> My remaining question would be whether there is a way to read the
>> <configuration> XML definition from the MOJO - I could then manually
>> implement such a verification in the different MOJOs.
>>
>> Please advise
>>
>> Thank you
>>
>> S. Ali Tokmen
>> http://ali.tokmen.com/
>>
>> My IM, GSM, PGP and other contact details
>> are on http://contact.ali.tokmen.com
>>
>> On 14/01/14 14:24, Baptiste Mathus wrote:
>>> Hi,
>>> Stephen already answered along those lines. What are you missing?
>>> Cheers
>>>
>>>
>>> 2014/1/9 S. Ali Tokmen <no...@alishomepage.com>
>>>
>>>> Hi Anders
>>>>
>>>> Thanks for your reply - and happy new year :)
>>>>
>>>> Is there any way I can inject / read the whole plugin configuration from
>>>> the plugin?
>>>>
>>>> Best regards
>>>>
>>>> S. Ali Tokmen
>>>> http://ali.tokmen.com/
>>>>
>>>> My IM, GSM, PGP and other contact details
>>>> are on http://contact.ali.tokmen.com
>>>>
>>>> On 08/01/14 20:00, Anders Hammar wrote:
>>>>> AFAIK there is no support for this. If you think there should be,
>> please
>>>>> file a ticket [1].
>>>>>
>>>>> /Anders
>>>>>
>>>>> [1] http://jira.codehaus.org/browse/MNG/
>>>>>
>>>>>
>>>>> On Tue, Jan 7, 2014 at 7:38 PM, S. Ali Tokmen <nospam@alishomepage.com
>>>>> wrote:
>>>>>
>>>>>> Dear Maven users
>>>>>>
>>>>>> I am one of the owners of Codehaus CARGO, which has a Maven2/Maven3
>>>>>> plugin; and would have a question with regards to how parameters are
>>>>>> managed.
>>>>>>
>>>>>> We defined our MOJOs with parameters (you can see
>>>>>>
>>>>>>
>> http://svn.codehaus.org/cargo/extensions/trunk/maven2/plugin/src/main/java/org/codehaus/cargo/maven2/AbstractCargoMojo.java
>>>>>> for example), but what happens is that if a user unwillingly puts a
>>>>>> parameter in the wrong place then the plugin execution doesn't stop.
>>>>>>
>>>>>> As an example, I can write the below POM and build still works (even
>>>>>> thought the MOJO has no parameter called "foo"):
>>>>>>
>>>>>>   <plugin>
>>>>>>     <groupId>org.codehaus.cargo</groupId>
>>>>>>     <artifactId>cargo-maven2-plugin</artifactId>
>>>>>>     <version>1.4.6</version>
>>>>>>     <configuration>
>>>>>>       <foo>
>>>>>>         bar
>>>>>>       </foo>
>>>>>>     </configuration>
>>>>>>   </plugin>
>>>>>>
>>>>>> Is there any way I can instruct by MOJO to fail if there is an unknown
>>>>>> parameter?
>>>>>>
>>>>>> Please advise
>>>>>>
>>>>>> Thank you
>>>>>>
>>>>>> --
>>>>>>
>>>>>> S. Ali Tokmen
>>>>>> http://ali.tokmen.com/
>>>>>>
>>>>>> My IM, GSM, PGP and other contact details
>>>>>> are on http://contact.ali.tokmen.com
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>> --
>>>> Baptiste <Batmat> MATHUS - http://batmat.net
>>>> Sauvez un arbre,
>>>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>


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


Re: Maven2/Maven3 plugin development: Ensuring only the available parameters are allowed

Posted by Anders Hammar <an...@hammar.net>.
Don't think that's doable as the user could configure the params for
different goals in the same configuration section (on plugin level, not
execution level).

/Anders


On Tue, Jan 14, 2014 at 7:38 PM, S. Ali Tokmen <no...@alishomepage.com>wrote:

> Hi Baptiste, Thomas
>
> I guess you all got a point :) The reason why I want to check the
> configuration is indeed something that would have to be done in each goal.
>
> My remaining question would be whether there is a way to read the
> <configuration> XML definition from the MOJO - I could then manually
> implement such a verification in the different MOJOs.
>
> Please advise
>
> Thank you
>
> S. Ali Tokmen
> http://ali.tokmen.com/
>
> My IM, GSM, PGP and other contact details
> are on http://contact.ali.tokmen.com
>
> On 14/01/14 14:24, Baptiste Mathus wrote:
> > Hi,
> > Stephen already answered along those lines. What are you missing?
> > Cheers
> >
> >
> > 2014/1/9 S. Ali Tokmen <no...@alishomepage.com>
> >
> >> Hi Anders
> >>
> >> Thanks for your reply - and happy new year :)
> >>
> >> Is there any way I can inject / read the whole plugin configuration from
> >> the plugin?
> >>
> >> Best regards
> >>
> >> S. Ali Tokmen
> >> http://ali.tokmen.com/
> >>
> >> My IM, GSM, PGP and other contact details
> >> are on http://contact.ali.tokmen.com
> >>
> >> On 08/01/14 20:00, Anders Hammar wrote:
> >>> AFAIK there is no support for this. If you think there should be,
> please
> >>> file a ticket [1].
> >>>
> >>> /Anders
> >>>
> >>> [1] http://jira.codehaus.org/browse/MNG/
> >>>
> >>>
> >>> On Tue, Jan 7, 2014 at 7:38 PM, S. Ali Tokmen <nospam@alishomepage.com
> >>> wrote:
> >>>
> >>>> Dear Maven users
> >>>>
> >>>> I am one of the owners of Codehaus CARGO, which has a Maven2/Maven3
> >>>> plugin; and would have a question with regards to how parameters are
> >>>> managed.
> >>>>
> >>>> We defined our MOJOs with parameters (you can see
> >>>>
> >>>>
> >>
> http://svn.codehaus.org/cargo/extensions/trunk/maven2/plugin/src/main/java/org/codehaus/cargo/maven2/AbstractCargoMojo.java
> >>>> for example), but what happens is that if a user unwillingly puts a
> >>>> parameter in the wrong place then the plugin execution doesn't stop.
> >>>>
> >>>> As an example, I can write the below POM and build still works (even
> >>>> thought the MOJO has no parameter called "foo"):
> >>>>
> >>>>   <plugin>
> >>>>     <groupId>org.codehaus.cargo</groupId>
> >>>>     <artifactId>cargo-maven2-plugin</artifactId>
> >>>>     <version>1.4.6</version>
> >>>>     <configuration>
> >>>>       <foo>
> >>>>         bar
> >>>>       </foo>
> >>>>     </configuration>
> >>>>   </plugin>
> >>>>
> >>>> Is there any way I can instruct by MOJO to fail if there is an unknown
> >>>> parameter?
> >>>>
> >>>> Please advise
> >>>>
> >>>> Thank you
> >>>>
> >>>> --
> >>>>
> >>>> S. Ali Tokmen
> >>>> http://ali.tokmen.com/
> >>>>
> >>>> My IM, GSM, PGP and other contact details
> >>>> are on http://contact.ali.tokmen.com
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>
> >>>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >> --
> >> Baptiste <Batmat> MATHUS - http://batmat.net
> >> Sauvez un arbre,
> >> Mangez un castor ! nbsp;! <us...@maven.apache.org>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven2/Maven3 plugin development: Ensuring only the available parameters are allowed

Posted by "S. Ali Tokmen" <no...@alishomepage.com>.
Hi Baptiste, Thomas

I guess you all got a point :) The reason why I want to check the
configuration is indeed something that would have to be done in each goal.

My remaining question would be whether there is a way to read the
<configuration> XML definition from the MOJO - I could then manually
implement such a verification in the different MOJOs.

Please advise

Thank you

S. Ali Tokmen
http://ali.tokmen.com/

My IM, GSM, PGP and other contact details
are on http://contact.ali.tokmen.com

On 14/01/14 14:24, Baptiste Mathus wrote:
> Hi,
> Stephen already answered along those lines. What are you missing?
> Cheers
>
>
> 2014/1/9 S. Ali Tokmen <no...@alishomepage.com>
>
>> Hi Anders
>>
>> Thanks for your reply - and happy new year :)
>>
>> Is there any way I can inject / read the whole plugin configuration from
>> the plugin?
>>
>> Best regards
>>
>> S. Ali Tokmen
>> http://ali.tokmen.com/
>>
>> My IM, GSM, PGP and other contact details
>> are on http://contact.ali.tokmen.com
>>
>> On 08/01/14 20:00, Anders Hammar wrote:
>>> AFAIK there is no support for this. If you think there should be, please
>>> file a ticket [1].
>>>
>>> /Anders
>>>
>>> [1] http://jira.codehaus.org/browse/MNG/
>>>
>>>
>>> On Tue, Jan 7, 2014 at 7:38 PM, S. Ali Tokmen <nospam@alishomepage.com
>>> wrote:
>>>
>>>> Dear Maven users
>>>>
>>>> I am one of the owners of Codehaus CARGO, which has a Maven2/Maven3
>>>> plugin; and would have a question with regards to how parameters are
>>>> managed.
>>>>
>>>> We defined our MOJOs with parameters (you can see
>>>>
>>>>
>> http://svn.codehaus.org/cargo/extensions/trunk/maven2/plugin/src/main/java/org/codehaus/cargo/maven2/AbstractCargoMojo.java
>>>> for example), but what happens is that if a user unwillingly puts a
>>>> parameter in the wrong place then the plugin execution doesn't stop.
>>>>
>>>> As an example, I can write the below POM and build still works (even
>>>> thought the MOJO has no parameter called "foo"):
>>>>
>>>>   <plugin>
>>>>     <groupId>org.codehaus.cargo</groupId>
>>>>     <artifactId>cargo-maven2-plugin</artifactId>
>>>>     <version>1.4.6</version>
>>>>     <configuration>
>>>>       <foo>
>>>>         bar
>>>>       </foo>
>>>>     </configuration>
>>>>   </plugin>
>>>>
>>>> Is there any way I can instruct by MOJO to fail if there is an unknown
>>>> parameter?
>>>>
>>>> Please advise
>>>>
>>>> Thank you
>>>>
>>>> --
>>>>
>>>> S. Ali Tokmen
>>>> http://ali.tokmen.com/
>>>>
>>>> My IM, GSM, PGP and other contact details
>>>> are on http://contact.ali.tokmen.com
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>> --
>> Baptiste <Batmat> MATHUS - http://batmat.net
>> Sauvez un arbre,
>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>>


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


Re: Maven2/Maven3 plugin development: Ensuring only the available parameters are allowed

Posted by Baptiste Mathus <ml...@batmat.net>.
Hi,
Stephen already answered along those lines. What are you missing?
Cheers


2014/1/9 S. Ali Tokmen <no...@alishomepage.com>

> Hi Anders
>
> Thanks for your reply - and happy new year :)
>
> Is there any way I can inject / read the whole plugin configuration from
> the plugin?
>
> Best regards
>
> S. Ali Tokmen
> http://ali.tokmen.com/
>
> My IM, GSM, PGP and other contact details
> are on http://contact.ali.tokmen.com
>
> On 08/01/14 20:00, Anders Hammar wrote:
> > AFAIK there is no support for this. If you think there should be, please
> > file a ticket [1].
> >
> > /Anders
> >
> > [1] http://jira.codehaus.org/browse/MNG/
> >
> >
> > On Tue, Jan 7, 2014 at 7:38 PM, S. Ali Tokmen <nospam@alishomepage.com
> >wrote:
> >
> >> Dear Maven users
> >>
> >> I am one of the owners of Codehaus CARGO, which has a Maven2/Maven3
> >> plugin; and would have a question with regards to how parameters are
> >> managed.
> >>
> >> We defined our MOJOs with parameters (you can see
> >>
> >>
> http://svn.codehaus.org/cargo/extensions/trunk/maven2/plugin/src/main/java/org/codehaus/cargo/maven2/AbstractCargoMojo.java
> >> for example), but what happens is that if a user unwillingly puts a
> >> parameter in the wrong place then the plugin execution doesn't stop.
> >>
> >> As an example, I can write the below POM and build still works (even
> >> thought the MOJO has no parameter called "foo"):
> >>
> >>   <plugin>
> >>     <groupId>org.codehaus.cargo</groupId>
> >>     <artifactId>cargo-maven2-plugin</artifactId>
> >>     <version>1.4.6</version>
> >>     <configuration>
> >>       <foo>
> >>         bar
> >>       </foo>
> >>     </configuration>
> >>   </plugin>
> >>
> >> Is there any way I can instruct by MOJO to fail if there is an unknown
> >> parameter?
> >>
> >> Please advise
> >>
> >> Thank you
> >>
> >> --
> >>
> >> S. Ali Tokmen
> >> http://ali.tokmen.com/
> >>
> >> My IM, GSM, PGP and other contact details
> >> are on http://contact.ali.tokmen.com
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>

Re: Maven2/Maven3 plugin development: Ensuring only the available parameters are allowed

Posted by "S. Ali Tokmen" <no...@alishomepage.com>.
Hi Anders

Thanks for your reply - and happy new year :)

Is there any way I can inject / read the whole plugin configuration from
the plugin?

Best regards

S. Ali Tokmen
http://ali.tokmen.com/

My IM, GSM, PGP and other contact details
are on http://contact.ali.tokmen.com

On 08/01/14 20:00, Anders Hammar wrote:
> AFAIK there is no support for this. If you think there should be, please
> file a ticket [1].
>
> /Anders
>
> [1] http://jira.codehaus.org/browse/MNG/
>
>
> On Tue, Jan 7, 2014 at 7:38 PM, S. Ali Tokmen <no...@alishomepage.com>wrote:
>
>> Dear Maven users
>>
>> I am one of the owners of Codehaus CARGO, which has a Maven2/Maven3
>> plugin; and would have a question with regards to how parameters are
>> managed.
>>
>> We defined our MOJOs with parameters (you can see
>>
>> http://svn.codehaus.org/cargo/extensions/trunk/maven2/plugin/src/main/java/org/codehaus/cargo/maven2/AbstractCargoMojo.java
>> for example), but what happens is that if a user unwillingly puts a
>> parameter in the wrong place then the plugin execution doesn't stop.
>>
>> As an example, I can write the below POM and build still works (even
>> thought the MOJO has no parameter called "foo"):
>>
>>   <plugin>
>>     <groupId>org.codehaus.cargo</groupId>
>>     <artifactId>cargo-maven2-plugin</artifactId>
>>     <version>1.4.6</version>
>>     <configuration>
>>       <foo>
>>         bar
>>       </foo>
>>     </configuration>
>>   </plugin>
>>
>> Is there any way I can instruct by MOJO to fail if there is an unknown
>> parameter?
>>
>> Please advise
>>
>> Thank you
>>
>> --
>>
>> S. Ali Tokmen
>> http://ali.tokmen.com/
>>
>> My IM, GSM, PGP and other contact details
>> are on http://contact.ali.tokmen.com
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>


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


Re: Maven2/Maven3 plugin development: Ensuring only the available parameters are allowed

Posted by Anders Hammar <an...@hammar.net>.
AFAIK there is no support for this. If you think there should be, please
file a ticket [1].

/Anders

[1] http://jira.codehaus.org/browse/MNG/


On Tue, Jan 7, 2014 at 7:38 PM, S. Ali Tokmen <no...@alishomepage.com>wrote:

> Dear Maven users
>
> I am one of the owners of Codehaus CARGO, which has a Maven2/Maven3
> plugin; and would have a question with regards to how parameters are
> managed.
>
> We defined our MOJOs with parameters (you can see
>
> http://svn.codehaus.org/cargo/extensions/trunk/maven2/plugin/src/main/java/org/codehaus/cargo/maven2/AbstractCargoMojo.java
> for example), but what happens is that if a user unwillingly puts a
> parameter in the wrong place then the plugin execution doesn't stop.
>
> As an example, I can write the below POM and build still works (even
> thought the MOJO has no parameter called "foo"):
>
>   <plugin>
>     <groupId>org.codehaus.cargo</groupId>
>     <artifactId>cargo-maven2-plugin</artifactId>
>     <version>1.4.6</version>
>     <configuration>
>       <foo>
>         bar
>       </foo>
>     </configuration>
>   </plugin>
>
> Is there any way I can instruct by MOJO to fail if there is an unknown
> parameter?
>
> Please advise
>
> Thank you
>
> --
>
> S. Ali Tokmen
> http://ali.tokmen.com/
>
> My IM, GSM, PGP and other contact details
> are on http://contact.ali.tokmen.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>