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
- Direct Known Subclasses:
DevMojo
@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 configuration files found in
META-INF/spring/*.xml, and
camel-*.xml and starting up the context.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.maven.artifact.resolver.ArtifactResolverprotected StringSets the time duration (seconds) that the application will run for before terminating.protected StringSets the idle time duration (seconds) duration that the application can be idle before terminating.protected StringSets the duration of maximum number of messages that the application will process before terminating.protected Stringprotected booleanWhether to log the classpath when startingprotected StringWhether to use built-in console logging (uses log4j), which does not require to add any logging dependency to your project.protected StringTo run with a specific Camel Main profile (dev,test,prod)protected org.apache.maven.project.MavenProjectThe maven project.protected BooleanWhether to use Kamelet (camel-main-kamelet) when running, instead of SpringFields inherited from class org.codehaus.mojo.exec.AbstractExecMojo
classpathScope, repositorySystemFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAllows plugin extensions to do custom logic after bootstrapping Camel.protected voidAllows plugin extensions to do custom logic before bootstrapping Camel.protected Set<org.apache.maven.artifact.Artifact> Determine all plugin dependencies relevant to the executable.voidexecute()Execute goal.protected org.apache.maven.artifact.ArtifactExamine the plugin dependencies to find the executable artifact.protected List<org.apache.maven.artifact.Artifact> protected Stringgoal()Methods inherited from class org.codehaus.mojo.exec.AbstractExecMojo
collectProjectArtifactsAndClasspath, getPluginDependencies, getSession, hasCommandlineArgs, isSkip, parseCommandlineArgs, registerSourceRootsMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
project
@Parameter(property="project", required=true, readonly=true) protected org.apache.maven.project.MavenProject projectThe maven project. -
duration
Sets the time duration (seconds) that the application will run for before terminating. A value invalid input: '<'= 0 will run forever. -
durationIdle
Sets the idle time duration (seconds) duration that the application can be idle before terminating. A value invalid input: '<'= 0 will run forever. -
durationMaxMessages
@Parameter(property="camel.duration.maxMessages", defaultValue="-1") protected String durationMaxMessagesSets the duration of maximum number of messages that the application will process before terminating. -
logClasspath
@Parameter(property="camel.logClasspath", defaultValue="false") protected boolean logClasspathWhether to log the classpath when starting -
loggingLevel
Whether to use built-in console logging (uses log4j), which does not require to add any logging dependency to your project. However, the logging is fixed to log to the console, with a color style that is similar to Spring Boot. You can change the root logging level to: FATAL, ERROR, WARN, INFO, DEBUG, TRACE, OFF -
useKamelet
Whether to use Kamelet (camel-main-kamelet) when running, instead of Spring -
profile
To run with a specific Camel Main profile (dev,test,prod) -
extendedPluginDependencyArtifactId
-
artifactResolver
@Component protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
-
-
Constructor Details
-
RunMojo
public RunMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionExecute 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...
-
goal
-
beforeBootstrapCamel
Allows plugin extensions to do custom logic before bootstrapping Camel.- Throws:
Exception
-
afterBootstrapCamel
Allows plugin extensions to do custom logic after bootstrapping Camel.- Throws:
Exception
-
getClasspath
protected List<org.apache.maven.artifact.Artifact> getClasspath() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Returns:
- the list of artifacts corresponding to the classpath to use when launching the application
- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
determineRelevantPluginDependencies
protected Set<org.apache.maven.artifact.Artifact> determineRelevantPluginDependencies() throws org.apache.maven.plugin.MojoExecutionExceptionDetermine all plugin dependencies relevant to the executable. Takes includePlugins, and the executableDependency into consideration.- Overrides:
determineRelevantPluginDependenciesin classorg.codehaus.mojo.exec.AbstractExecMojo- Returns:
- a set of Artifact objects. (Empty set is returned if there are no relevant plugin dependencies.)
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
findExecutableArtifact
protected org.apache.maven.artifact.Artifact findExecutableArtifact() throws org.apache.maven.plugin.MojoExecutionExceptionExamine the plugin dependencies to find the executable artifact.- Overrides:
findExecutableArtifactin classorg.codehaus.mojo.exec.AbstractExecMojo- Returns:
- an artifact which refers to the actual executable tool (not a POM)
- Throws:
org.apache.maven.plugin.MojoExecutionException
-