org.codehaus.mojo.exec

Class AbstractExecMojo

public abstract class AbstractExecMojo extends AbstractMojo

This class is used for unifying functionality between the 2 mojo exec plugins ('java' and 'exec'). It handles parsing the arguments and adding source/test folders.

Author: Philippe Jacot (PJA) Jerome Lacoste

Field Summary
protected StringclasspathScope
Defines the scope of the classpath passed to the plugin.
protected MavenProjectproject
The enclosing project.
Method Summary
protected voidcollectProjectArtifactsAndClasspath(List artifacts, List theClasspathFiles)
Collects the project artifacts in the specified List and the project specific classpath (build output and build test output) Files in the specified List, depending on the plugin classpathScope value.
protected booleanhasCommandlineArgs()
protected String[]parseCommandlineArgs()
Parses the argument string given by the user.
protected voidregisterSourceRoots()
Register compile and compile tests source roots if necessary

Field Detail

classpathScope

protected String classpathScope
Defines the scope of the classpath passed to the plugin. Set to compile,test,runtime or system depending on your needs.

UNKNOWN: expression="${exec.classpathScope}" default-value="compile"

project

protected MavenProject project
The enclosing project.

UNKNOWN: expression="${project}"

Method Detail

collectProjectArtifactsAndClasspath

protected void collectProjectArtifactsAndClasspath(List artifacts, List theClasspathFiles)
Collects the project artifacts in the specified List and the project specific classpath (build output and build test output) Files in the specified List, depending on the plugin classpathScope value.

Parameters: artifacts the list where to collect the scope specific artifacts theClasspathFiles the list where to collect the scope specific output directories

Throws: NullPointerException if at least one of the parameter is null

hasCommandlineArgs

protected boolean hasCommandlineArgs()

Returns: true of the mojo has command line arguments

parseCommandlineArgs

protected String[] parseCommandlineArgs()
Parses the argument string given by the user. Strings are recognized as everything between STRING_WRAPPER. PARAMETER_DELIMITER is ignored inside a string. STRING_WRAPPER and PARAMETER_DELIMITER can be escaped using ESCAPE_CHAR.

Returns: Array of String representing the arguments

Throws: MojoExecutionException for wrong formatted arguments

registerSourceRoots

protected void registerSourceRoots()
Register compile and compile tests source roots if necessary
Copyright © 2005-2009 Codehaus. All Rights Reserved.