RE: Plugin Development Issue
Many thanks. This is the answer just worked it out - appreciate your time and willingness to help. Kind regards, -- Marc -Original Message- From: William Ferguson [mailto:[EMAIL PROTECTED] Sent: 25 August 2006 08:32 To: Maven Users List Subject: RE: Plugin Development Issue To allow your parameter to be specified from the command line yoour parameter specification needs to define the name of the commandline parameter that it will accept. Eg /** * @parameter expression="${foo.bar}" */ private String verbose; Should work with a commandline of mvn cleartrust:extract -Dfoo.bar=Testing The POM configuration should work. Are you sure you've defined the verbose element within your plugin definition's block? William -Original Message- > From: Marc L. Veary [mailto:[EMAIL PROTECTED] > Sent: Friday, 25 August 2006 4:57 PM > To: 'Maven Users' > Subject: Plugin Development Issue > > Hi, > > I have developed a very simple plugin that does nothing. > (code included below). > > The problem is that I cannot seem to pass in a parameter > either on the command line or via a POM (in another project > that defines this plugin in the section): > > mvn cleartrust:extract -Dverbose=Testing > > or > > > testing > > > Could someone point me in the right direction here? > > package uk.co.nwlcoc.aa.maven.plugins; > > import org.apache.maven.plugin.AbstractMojo; > import org.apache.maven.plugin.MojoExecutionException; > import org.apache.maven.plugin.MojoFailureException; > > /** > * @goal extract > * @phase package > * @author Marc > * @version $LastChangedRevision$ > */ > public class ClearTrustMojo extends AbstractMojo { > /** >* @parameter >*/ > private String verbose; > > public void execute() throws MojoExecutionException, > MojoFailureException > { > getLog().info( ">> " + verbose ); > } > > } > > http://maven.apache.org/POM/4.0.0"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd";> > 4.0.0 > uk.co.nwlcoc.aa.maven.plugins > maven-cleartrust-plugin > maven-plugin > 1.0-SNAPSHOT > ClearTrust Mojo > > > org.apache.maven > maven-plugin-api > 2.0 > > > > > Kind regards, > -- > Marc > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Plugin Development Issue
To allow your parameter to be specified from the command line yoour parameter specification needs to define the name of the commandline parameter that it will accept. Eg /** * @parameter expression="${foo.bar}" */ private String verbose; Should work with a commandline of mvn cleartrust:extract -Dfoo.bar=Testing The POM configuration should work. Are you sure you've defined the verbose element within your plugin definition's block? William -Original Message- > From: Marc L. Veary [mailto:[EMAIL PROTECTED] > Sent: Friday, 25 August 2006 4:57 PM > To: 'Maven Users' > Subject: Plugin Development Issue > > Hi, > > I have developed a very simple plugin that does nothing. > (code included below). > > The problem is that I cannot seem to pass in a parameter > either on the command line or via a POM (in another project > that defines this plugin in the section): > > mvn cleartrust:extract -Dverbose=Testing > > or > > > testing > > > Could someone point me in the right direction here? > > package uk.co.nwlcoc.aa.maven.plugins; > > import org.apache.maven.plugin.AbstractMojo; > import org.apache.maven.plugin.MojoExecutionException; > import org.apache.maven.plugin.MojoFailureException; > > /** > * @goal extract > * @phase package > * @author Marc > * @version $LastChangedRevision$ > */ > public class ClearTrustMojo extends AbstractMojo { > /** >* @parameter >*/ > private String verbose; > > public void execute() throws MojoExecutionException, > MojoFailureException > { > getLog().info( ">> " + verbose ); > } > > } > > http://maven.apache.org/POM/4.0.0"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd";> > 4.0.0 > uk.co.nwlcoc.aa.maven.plugins > maven-cleartrust-plugin > maven-plugin > 1.0-SNAPSHOT > ClearTrust Mojo > > > org.apache.maven > maven-plugin-api > 2.0 > > > > > Kind regards, > -- > Marc > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Plugin Development Issue
Ha! Yet again. Everytime I email this list for some help, I then solve the problem... sorry all. The answer to the problem seems to be that one must provide the 'expression' to the annotation: /** * @parameter expression="${verbose}" */ private String verbose; This now works from both POM and command line. Many apologies for any time wasted. Kind regards, -- Marc -Original Message- From: Marc L. Veary [mailto:[EMAIL PROTECTED] Sent: 25 August 2006 07:57 To: 'Maven Users' Subject: Plugin Development Issue Hi, I have developed a very simple plugin that does nothing. (code included below). The problem is that I cannot seem to pass in a parameter either on the command line or via a POM (in another project that defines this plugin in the section): mvn cleartrust:extract -Dverbose=Testing or testing Could someone point me in the right direction here? package uk.co.nwlcoc.aa.maven.plugins; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; /** * @goal extract * @phase package * @author Marc * @version $LastChangedRevision$ */ public class ClearTrustMojo extends AbstractMojo { /** * @parameter */ private String verbose; public void execute() throws MojoExecutionException, MojoFailureException { getLog().info( ">> " + verbose ); } } http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";> 4.0.0 uk.co.nwlcoc.aa.maven.plugins maven-cleartrust-plugin maven-plugin 1.0-SNAPSHOT ClearTrust Mojo org.apache.maven maven-plugin-api 2.0 Kind regards, -- Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Plugin Development Issue
Hi, I have developed a very simple plugin that does nothing. (code included below). The problem is that I cannot seem to pass in a parameter either on the command line or via a POM (in another project that defines this plugin in the section): mvn cleartrust:extract -Dverbose=Testing or testing Could someone point me in the right direction here? package uk.co.nwlcoc.aa.maven.plugins; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; /** * @goal extract * @phase package * @author Marc * @version $LastChangedRevision$ */ public class ClearTrustMojo extends AbstractMojo { /** * @parameter */ private String verbose; public void execute() throws MojoExecutionException, MojoFailureException { getLog().info( ">> " + verbose ); } } http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";> 4.0.0 uk.co.nwlcoc.aa.maven.plugins maven-cleartrust-plugin maven-plugin 1.0-SNAPSHOT ClearTrust Mojo org.apache.maven maven-plugin-api 2.0 Kind regards, -- Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]