dan tran wrote:

>http://maven.apache.org/guides/plugin/guide-java-plugin-development.html
>
>after that, you can use -Dkey=value to override any configurations
>(parameters) of hte plugin
>
>-Dan
>
>  
>
I'm having a hard time getting this to work. Here's a snippet of my
plugin source:

/**
 * This plugin is used to create and run an SDIF pipeline.
 *
 * @goal sdif
 * @description This plugin is used to create and run an SDIF pipeline.
 * @requiresProject false
 */
public class SdifPlugin extends AbstractMojo {
    /**
     * The XML configuration file for the pipeline to run.
     * @parameter
     */
    protected File pipeConfig;

    /**
     * The XML configuration file for the log4j logging system.
     * @parameter
     */
    protected File logConfig;

    /**
     * A list of objects to enqueue onto the first stage of the pipeline.
     * @parameter
     */
    protected List<Object> queueElements;

    public void execute() throws MojoExecutionException {
        if (pipeConfig == null || !pipeConfig.exists()) {
            throw new MojoExecutionException(this, "You must specify the
location of the pipeline configuration file.", null);
        }
        ...
    }
}

I install the plugin as usual...

mvn -e -DpipeConfig=acars_conf.xml -DlogConfig=log4j_acars.xml
eds:m2-sdif-plugin:0.1-SNAPSHOT:sdif

[INFO]
----------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
----------------------------------------------------------------------------
[INFO] : [EMAIL PROTECTED]
You must specify the location of the pipeline configuration file.
[INFO]
----------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: You must specify
the location of the pipeline configuration file.
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:485)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:455)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:216)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: You must
specify the location of the pipeline configuration file.
        at gov.noaa.eds.sdif.m2.SdifPlugin.execute(SdifPlugin.java:57)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:432)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:530)


The plugin is clearly getting run, but the file (which is in the
directory that I'm running the plugin from) is not being found.

Thanks for your help,

Kris

>On 12/13/05, Kris Nuttycombe <[EMAIL PROTECTED]> wrote:
>  
>
>>Hi, all,
>>
>>I'm currently in the process of developing my first Maven 2.0 plugin.
>>I've been able to figure out everything except how to add custom
>>command-line arguments. Can anyone point out some documentation of how
>>to do this?
>>
>>For example, I want to do the following:
>>
>>mvn -Dmyarg1=val1 -Dmyarg2=val2 myplugin:mygoal
>>
>>Thanks,
>>
>>Kris
>>
>>
>>
>>---------------------------------------------------------------------
>>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