Package org.apache.camel.maven
Class RunMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.exec.AbstractExecMojo
-
- org.apache.camel.maven.RunMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="run", defaultPhase=PREPARE_PACKAGE, requiresDependencyResolution=COMPILE_PLUS_RUNTIME) public class RunMojo extends org.codehaus.mojo.exec.AbstractExecMojo
Runs a CamelContext using any Spring or Blueprint XML configuration files found inMETA-INF/spring/*.xml
, andOSGI-INF/blueprint/*.xml
, andcamel-*.xml
and starting up the context.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
duration
Sets the time duration (seconds) that the application will run for before terminating.protected String
durationIdle
Sets the idle time duration (seconds) duration that the application can be idle before terminating.protected String
durationMaxMessages
Sets the duration of maximum number of messages that the application will process before terminating.protected String
extendedPluginDependencyArtifactId
protected boolean
logClasspath
Whether to log the classpath when startingprotected org.apache.maven.project.MavenProject
project
The maven project.protected Boolean
useBlueprint
Whether to use Blueprint when running, instead of Springprotected Boolean
useCDI
Whether to use CDI when running, instead of Spring
-
Constructor Summary
Constructors Constructor Description RunMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterBootstrapCamel()
Allows plugin extensions to do custom logic after bootstrapping Camel.protected void
beforeBootstrapCamel()
Allows plugin extensions to do custom logic before bootstrapping Camel.void
execute()
Execute goal.protected org.apache.maven.artifact.Artifact
findExecutableArtifact()
Examine the plugin dependencies to find the executable artifact.-
Methods inherited from class org.codehaus.mojo.exec.AbstractExecMojo
collectProjectArtifactsAndClasspath, hasCommandlineArgs, isSkip, parseCommandlineArgs, registerSourceRoots
-
-
-
-
Field Detail
-
project
@Parameter(property="project", required=true, readonly=true) protected org.apache.maven.project.MavenProject project
The maven project.
-
duration
@Parameter(property="camel.duration", defaultValue="-1") protected String duration
Sets the time duration (seconds) that the application will run for before terminating. A value <= 0 will run forever.
-
durationIdle
@Parameter(property="camel.durationIdle", defaultValue="-1") protected String durationIdle
Sets the idle time duration (seconds) duration that the application can be idle before terminating. A value <= 0 will run forever.
-
durationMaxMessages
@Parameter(property="camel.duration.maxMessages", defaultValue="-1") protected String durationMaxMessages
Sets the duration of maximum number of messages that the application will process before terminating.
-
logClasspath
@Parameter(property="camel.logClasspath", defaultValue="false") protected boolean logClasspath
Whether to log the classpath when starting
-
useBlueprint
@Parameter(property="camel.useBlueprint") protected Boolean useBlueprint
Whether to use Blueprint when running, instead of Spring
-
useCDI
@Parameter(property="camel.useCDI") protected Boolean useCDI
Whether to use CDI when running, instead of Spring
-
extendedPluginDependencyArtifactId
protected String extendedPluginDependencyArtifactId
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
Execute goal.- Throws:
org.apache.maven.plugin.MojoExecutionException
- execution of the main class or one of the threads it generated failed.org.apache.maven.plugin.MojoFailureException
- something bad happened...
-
beforeBootstrapCamel
protected void beforeBootstrapCamel() throws Exception
Allows plugin extensions to do custom logic before bootstrapping Camel.- Throws:
Exception
-
afterBootstrapCamel
protected void afterBootstrapCamel() throws Exception
Allows plugin extensions to do custom logic after bootstrapping Camel.- Throws:
Exception
-
findExecutableArtifact
protected org.apache.maven.artifact.Artifact findExecutableArtifact() throws org.apache.maven.plugin.MojoExecutionException
Examine the plugin dependencies to find the executable artifact.- Overrides:
findExecutableArtifact
in classorg.codehaus.mojo.exec.AbstractExecMojo
- Returns:
- an artifact which refers to the actual executable tool (not a POM)
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-