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 <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]

Reply via email to