You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "sean.chen(陈思淼)" <ch...@gmail.com> on 2008/10/23 08:14:52 UTC

How to send argument to plugin

I know We can use mvn XXX -DmyArg=XXX to send the argument to the plugin.but
how can I get it in my plugin?

RE: How to send argument to plugin

Posted by EJ Ciramella <ec...@upromise.com>.
Via the <configuration> tags.

There you should have:

<configuration>
	<foo>bar</foo>
</configuration>

And if you need to pass it in on the command line, you may want to do something more like:

<properties>
	<foo>bar</foo>
</properties> 

...

<configuration>
	<foo>${prop}</foo>
</configuration>

So if someone uses -Dfoo=someval, that will take precedence and if nothing is specified, the properties block will take precedence.

-----Original Message-----
From: sean.chen(陈思淼) [mailto:chensimiao@gmail.com] 
Sent: Thursday, October 23, 2008 2:15 AM
To: Maven Users List
Subject: How to send argument to plugin

I know We can use mvn XXX -DmyArg=XXX to send the argument to the plugin.but how can I get it in my plugin?