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 <configuration> 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 <build> section):
>
> mvn cleartrust:extract -Dverbose=Testing
>
> or
>
> <configuration>
> <verbose>testing</verbose>
> </configuration>
>
> 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 );
> }
>
> }
>
> <project xmlns="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">
> <modelVersion>4.0.0</modelVersion>
> <groupId>uk.co.nwlcoc.aa.maven.plugins</groupId>
> <artifactId>maven-cleartrust-plugin</artifactId>
> <packaging>maven-plugin</packaging>
> <version>1.0-SNAPSHOT</version>
> <name>ClearTrust Mojo</name>
> <dependencies>
> <dependency>
> <groupId>org.apache.maven</groupId>
> <artifactId>maven-plugin-api</artifactId>
> <version>2.0</version>
> </dependency>
> </dependencies>
> </project>
>
> 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]