exec:exec

Full name:

org.codehaus.mojo:exec-maven-plugin:1.2.1:exec

Description:

A Plugin for executing external programs.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: test.
  • Since version: 1.0.

Required Parameters

Name Type Since Description
executable String 1.0

The executable. Can be a full path or a the name executable. In the latter case, the executable must be in the PATH for the execution to work.

The plugin will search for the executable in the following order:

  1. relative to the root of the project
  2. as toolchain executable
  3. relative to the working directory (Windows only)
  4. relative to the directories specified in the system property PATH (Windows Only)
Otherwise use the executable as is.


Optional Parameters

Name Type Since Description
arguments List 1.0

A list of arguments passed to the executable, which should be of type <argument> or <classpath>. Can be overridden by using the exec.args environment variable.


classpathScope String 1.0 Defines the scope of the classpath passed to the plugin. Set to compile,test,runtime or system depending on your needs. Since 1.1.2, the default value is 'runtime' instead of 'compile'.
Default value is: runtime.
commandlineArgs String 1.0 Arguments for the executed program
environmentVariables Map 1.1-beta-2 Environment variables to pass to the executed program.
longClasspath boolean 1.1.2 If set to true the classpath and the main class will be written to a MANIFEST.MF file and wrapped into a jar. Instead of '-classpath/-cp CLASSPATH mainClass' the exec plugin executes '-jar maven-exec.jar'.
Default value is: false.
outputFile File 1.1-beta-2 Program standard and error output will be redirected to the file specified by this optional field. If not specified the standard maven logging is used.
skip boolean 1.0.1 Skip the execution.
Default value is: false.
sourceRoot File 1.0 This folder is added to the list of those folders containing source to be compiled. Use this if your plugin generates source code.
successCodes int[] 1.1.1 Exit codes to be resolved as successful execution for non-compliant applications (applications not returning 0 for success).
testSourceRoot File 1.0 This folder is added to the list of those folders containing source to be compiled for testing. Use this if your plugin generates test source code.
workingDirectory File 1.0 The current working directory. Optional. If not specified, basedir will be used.

Parameter Details

arguments:

A list of arguments passed to the executable, which should be of type <argument> or <classpath>. Can be overridden by using the exec.args environment variable.

  • Type: java.util.List
  • Since: 1.0
  • Required: No

classpathScope:

Defines the scope of the classpath passed to the plugin. Set to compile,test,runtime or system depending on your needs. Since 1.1.2, the default value is 'runtime' instead of 'compile'.
  • Type: java.lang.String
  • Since: 1.0
  • Required: No
  • Expression: ${exec.classpathScope}
  • Default: runtime

commandlineArgs:

Arguments for the executed program
  • Type: java.lang.String
  • Since: 1.0
  • Required: No
  • Expression: ${exec.args}

environmentVariables:

Environment variables to pass to the executed program.
  • Type: java.util.Map
  • Since: 1.1-beta-2
  • Required: No

executable:

The executable. Can be a full path or a the name executable. In the latter case, the executable must be in the PATH for the execution to work.

The plugin will search for the executable in the following order:

  1. relative to the root of the project
  2. as toolchain executable
  3. relative to the working directory (Windows only)
  4. relative to the directories specified in the system property PATH (Windows Only)
Otherwise use the executable as is.

  • Type: java.lang.String
  • Since: 1.0
  • Required: Yes
  • Expression: ${exec.executable}

longClasspath:

If set to true the classpath and the main class will be written to a MANIFEST.MF file and wrapped into a jar. Instead of '-classpath/-cp CLASSPATH mainClass' the exec plugin executes '-jar maven-exec.jar'.
  • Type: boolean
  • Since: 1.1.2
  • Required: No
  • Expression: ${exec.longClasspath}
  • Default: false

outputFile:

Program standard and error output will be redirected to the file specified by this optional field. If not specified the standard maven logging is used.
  • Type: java.io.File
  • Since: 1.1-beta-2
  • Required: No
  • Expression: ${exec.outputFile}

skip:

Skip the execution.
  • Type: boolean
  • Since: 1.0.1
  • Required: No
  • Expression: ${skip}
  • Default: false

sourceRoot:

This folder is added to the list of those folders containing source to be compiled. Use this if your plugin generates source code.
  • Type: java.io.File
  • Since: 1.0
  • Required: No
  • Expression: ${sourceRoot}

successCodes:

Exit codes to be resolved as successful execution for non-compliant applications (applications not returning 0 for success).
  • Type: int[]
  • Since: 1.1.1
  • Required: No

testSourceRoot:

This folder is added to the list of those folders containing source to be compiled for testing. Use this if your plugin generates test source code.
  • Type: java.io.File
  • Since: 1.0
  • Required: No
  • Expression: ${testSourceRoot}

workingDirectory:

The current working directory. Optional. If not specified, basedir will be used.
  • Type: java.io.File
  • Since: 1.0
  • Required: No
  • Expression: ${exec.workingdir}