You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Aaron Digulla <di...@hepe.com> on 2007/02/01 14:50:42 UTC

Where can I find command line properties??

Hello,

I have a mojo which has dynamic parameters/properties which have to be  
specified via the commandline.

When I'm in my execute() method, what do I have to call to see "value"  
when I call mvn with "-Dtest=value"?

They aren't in MavenProject/Model.getProperties()...

Regards,

-- 
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
http://www.pdark.de/

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


Re: Where can I find command line properties??

Posted by Aaron Digulla <di...@hepe.com>.
Quoting Franz Allan Valencia See <fr...@gmail.com>:

> Good day to you, Aaron,
>
> add @parameter to your mojos field so that it can be configured in the pom.

How do I add "@parameter" to my mojo at runtime? :-)

Some background: I'm currently extending the archetype plugin. In my  
new version, you can add arbitrary additional template  
parameters/variables to replace in the archetype templates.

Of course, I need a way for the user to specify them. That would be  
-D... on the command line. But I had trouble to find the additional  
properties. To my surprise, they seem to show up in System.properties.  
Is that the "official" place for all properties specified on the  
command line?

At second thought this makes sense since mvn.bat eventually calls  
java.exe with all the extra parameters...

Regards,


>> I have a mojo which has dynamic parameters/properties which have to be
>> specified via the commandline.
>>
>> When I'm in my execute() method, what do I have to call to see "value"
>> when I call mvn with "-Dtest=value"?
>>
>> They aren't in MavenProject/Model.getProperties()...
>>
>> Regards,
>>
>> --
>> Aaron "Optimizer" Digulla a.k.a. Philmann Dark
>> "It's not the universe that's limited, it's our imagination.
>> Follow me and I'll show you something beyond the limits."
>> http://www.pdark.de/
>>
>> ---------------------------------------------------------------------
>> 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



-- 
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
http://www.pdark.de/

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


Re: Where can I find command line properties??

Posted by Franz Allan Valencia See <fr...@gmail.com>.
Good day to you, Aaron,

add @parameter to your mojos field so that it can be configured in the pom.

/**
 * @parameter
 */
private String test;

add "expression=${...}" to @parameter so that it can be referenced as
a property ( i.e from the commandline )

/**
 * @parameter expression=${test}
 */
private String test;

Cheers,
Franz

On 2/1/07, Aaron Digulla <di...@hepe.com> wrote:
> Hello,
>
> I have a mojo which has dynamic parameters/properties which have to be
> specified via the commandline.
>
> When I'm in my execute() method, what do I have to call to see "value"
> when I call mvn with "-Dtest=value"?
>
> They aren't in MavenProject/Model.getProperties()...
>
> Regards,
>
> --
> Aaron "Optimizer" Digulla a.k.a. Philmann Dark
> "It's not the universe that's limited, it's our imagination.
> Follow me and I'll show you something beyond the limits."
> http://www.pdark.de/
>
> ---------------------------------------------------------------------
> 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