You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Robert Patrick <ro...@oracle.com> on 2013/09/20 06:44:01 UTC
Passing config parameters to a plugin goal on the command line
Hi,
We have a Maven plugin that previously was using the Maven Javadoc-style annotations. When we wanted to test out something quick and dirty, we were able to invoke the plugin goals from the command-line and pass in the configuration parameters using -Dparam=value like this:
mvn com.oracle.foo:foo-maven-plugin:1.0:mygoal -Darg1=abc -Darg2=def
in place of writing a POM and specifying the parameters in the configuration section of the plugin declaration.
We recently updated the plug-in code to using Maven Java 5-style annotations and have specified in the @Mojo(., requiresProject=false). I just discovered that using the -Dparam=value command-line args to pass in the plugin configuration parameters no longer works. Any thoughts on why this behavior has changed and/or how to pass configuration parameters on the command-line with a plug-in that is written with the Maven Java 5 annotations?
Thanks,
Robert
--
Robert Patrick <HYPERLINK "mailto:robert.patrick@oracle.com"robert.patrick@oracle.com>
VP, FMW Architects Team: The A-Team
Oracle Corporation Office: +1.940.725.0011
1148 Triple Crown Court Fax: +1.940.725.0012
Bartonville, TX 76226, USA Mobile: +1.469.556.9450
A-Team Chronicles Blog: http://www.ateam-oracle.com/
HYPERLINK "http://www.amazon.com/Professional-Oracle-WebLogic-Server-Patrick/dp/0470484306/"Professional Oracle WebLogic Server
by Robert Patrick, Gregory Nyberg, and Philip Aston
with Josh Bregman and Paul Done
Book Home Page: HYPERLINK "http://www.wrox.com/WileyCDA/WroxTitle/Professional-Oracle-WebLogic-Server.productCd-0470484306.html"http://www.wrox.com/
Kindle Version: HYPERLINK "http://www.amazon.com/Professional-Oracle-WebLogic-Server-ebook/dp/B004HD69J2/"http://www.amazon.com/
Re: Passing config parameters to a plugin goal on the command line
Posted by Anders Hammar <an...@hammar.net>.
As you found out and explained on the dev list, it does work if you apply
the correct annotation parameters in your plugin code.
/Anders
On Fri, Sep 20, 2013 at 6:44 AM, Robert Patrick
<ro...@oracle.com>wrote:
> Hi,
>
> We have a Maven plugin that previously was using the Maven Javadoc-style
> annotations. When we wanted to test out something quick and dirty, we were
> able to invoke the plugin goals from the command-line and pass in the
> configuration parameters using -Dparam=value like this:
>
> mvn com.oracle.foo:foo-maven-plugin:1.0:mygoal -Darg1=abc -Darg2=def
>
> in place of writing a POM and specifying the parameters in the
> configuration section of the plugin declaration.
>
> We recently updated the plug-in code to using Maven Java 5-style
> annotations and have specified in the @Mojo(., requiresProject=false). I
> just discovered that using the -Dparam=value command-line args to pass in
> the plugin configuration parameters no longer works. Any thoughts on why
> this behavior has changed and/or how to pass configuration parameters on
> the command-line with a plug-in that is written with the Maven Java 5
> annotations?
>
> Thanks,
> Robert
>
>
>
> --
>
> Robert Patrick <HYPERLINK "mailto:robert.patrick@oracle.com"
> robert.patrick@oracle.com>
>
> VP, FMW Architects Team: The A-Team
>
> Oracle Corporation Office: +1.940.725.0011
>
> 1148 Triple Crown Court Fax:
> +1.940.725.0012
>
> Bartonville, TX 76226, USA Mobile: +1.469.556.9450
>
>
>
> A-Team Chronicles Blog: http://www.ateam-oracle.com/
>
>
>
> HYPERLINK "
> http://www.amazon.com/Professional-Oracle-WebLogic-Server-Patrick/dp/0470484306/"Professional
> Oracle WebLogic Server
>
> by Robert Patrick, Gregory Nyberg, and Philip Aston
>
> with Josh Bregman and Paul Done
>
> Book Home Page: HYPERLINK "
> http://www.wrox.com/WileyCDA/WroxTitle/Professional-Oracle-WebLogic-Server.productCd-0470484306.html
> "http://www.wrox.com/
>
> Kindle Version: HYPERLINK "
> http://www.amazon.com/Professional-Oracle-WebLogic-Server-ebook/dp/B004HD69J2/
> "http://www.amazon.com/
>
>
>
>
>