You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gisbert Amm <gi...@webde-ag.de> on 2004/10/13 18:10:59 UTC

How to check if a command line option is set from within a Maven plugin

Hi,

I need to check from within a Maven plugin if a certain command line 
option is set or not. How do I do that? In systemScope I do not see 
these variables and I cannot find out where it might be written down.

Any help would be highly appreciated.

Regards,
Gisbert Amm

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


Re: How to check if a command line option is set from within a Maven plugin

Posted by Gisbert Amm <gi...@webde-ag.de>.
Sorry for the delay; I had to work on other things in the meantime.

I finally solved my problem by myself since I knew from your message 
that it should definitely work.

What I found out ist the following:

I tried to check ${!empty(systemScope['some.variable'])}

which always returned false (the variable is - or seems to be - empty), 
even if the variable was set. This was distracting me.

When I first save the value of the variable in the systemScope to a 
local variable

<j:set var="myvar" value="${systemScope['some.variable']}"/>

and then check if this local variable is not empty

${!empty(myvar)}

I get the right result ("true" if the variable is set).

Thanks for your support.

Gisbert



Brett Porter wrote:
> ${systemScope} should definitely work.
> 
> Do you have a small test case that reproduces it?
> 
> 
> On Thu, 14 Oct 2004 08:51:17 +0200, Gisbert Amm <gi...@webde-ag.de> wrote:
> 
>>system property (-D)
>>
>>
>>
>>Brett Porter wrote:
>>
>>>do you mean maven option (-o, -X, etc) or system property (-D)?
>>>
>>>
>>>On Wed, 13 Oct 2004 18:10:59 +0200, Gisbert Amm <gi...@webde-ag.de> wrote:
>>>
>>>
>>>>Hi,
>>>>
>>>>I need to check from within a Maven plugin if a certain command line
>>>>option is set or not. How do I do that? In systemScope I do not see
>>>>these variables and I cannot find out where it might be written down.
>>>>
>>>>Any help would be highly appreciated.
>>>>
>>>>Regards,
>>>>Gisbert Amm
>>>>
>>>>---------------------------------------------------------------------
>>>>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
>>
>>
> 
> 
> ---------------------------------------------------------------------
> 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: How to check if a command line option is set from within a Maven plugin

Posted by Brett Porter <br...@gmail.com>.
${systemScope} should definitely work.

Do you have a small test case that reproduces it?


On Thu, 14 Oct 2004 08:51:17 +0200, Gisbert Amm <gi...@webde-ag.de> wrote:
> system property (-D)
> 
> 
> 
> Brett Porter wrote:
> > do you mean maven option (-o, -X, etc) or system property (-D)?
> >
> >
> > On Wed, 13 Oct 2004 18:10:59 +0200, Gisbert Amm <gi...@webde-ag.de> wrote:
> >
> >>Hi,
> >>
> >>I need to check from within a Maven plugin if a certain command line
> >>option is set or not. How do I do that? In systemScope I do not see
> >>these variables and I cannot find out where it might be written down.
> >>
> >>Any help would be highly appreciated.
> >>
> >>Regards,
> >>Gisbert Amm
> >>
> >>---------------------------------------------------------------------
> >>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
> 
>

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


Re: How to check if a command line option is set from within a Maven plugin

Posted by Gisbert Amm <gi...@webde-ag.de>.
system property (-D)

Brett Porter wrote:
> do you mean maven option (-o, -X, etc) or system property (-D)?
> 
> 
> On Wed, 13 Oct 2004 18:10:59 +0200, Gisbert Amm <gi...@webde-ag.de> wrote:
> 
>>Hi,
>>
>>I need to check from within a Maven plugin if a certain command line
>>option is set or not. How do I do that? In systemScope I do not see
>>these variables and I cannot find out where it might be written down.
>>
>>Any help would be highly appreciated.
>>
>>Regards,
>>Gisbert Amm
>>
>>---------------------------------------------------------------------
>>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: How to check if a command line option is set from within a Maven plugin

Posted by Brett Porter <br...@gmail.com>.
do you mean maven option (-o, -X, etc) or system property (-D)?


On Wed, 13 Oct 2004 18:10:59 +0200, Gisbert Amm <gi...@webde-ag.de> wrote:
> Hi,
> 
> I need to check from within a Maven plugin if a certain command line
> option is set or not. How do I do that? In systemScope I do not see
> these variables and I cannot find out where it might be written down.
> 
> Any help would be highly appreciated.
> 
> Regards,
> Gisbert Amm
> 
> ---------------------------------------------------------------------
> 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