Sorry. I figured it out. I was missing the "expression" option with the
annotation. I thought that I had already tried that.
This works:
/**
* @parameter expression="${planId}" default-value="plan1"
*/
private String planId;
/**
* @parameter expression="${overwrite}" default-value="false"
*/
private boolean overwrite;
neworleansjim wrote:
>
> I created a custom mojo that has a couple of attributes I'd like to
> optionally set from the command line. I assume this would be something
> like -Doverwrite=true when invoking the plugin (like Release plugin's
> -DdryRun=true). But, I can't figure out how to get it to work.
>
> I'm also having problems with the @parameter default-value="mydefault" to
> set the default value when not provided in the <configuration> section for
> the plugin in a pom.
>
> The mojo works fine when values are set in a pom, but some values should
> be more flexible. I'm trying to set Strings and booleans.
>
> Here's sample attribute declarations:
>
> /**
> * @parameter default-value="false"
> */
> private boolean overwrite;
>
> /**
> * @parameter default-value="plan1"
> */
> private String planId;
>
>
> Thanks,
> Jim
>
--
View this message in context:
http://www.nabble.com/Custom-Mojo-problem-with--Dfield1%3Dvalue1-CLI-options-tp14532951s177p14533071.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]