Package org.codehaus.cargo.maven3
Class ContainerRunMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.cargo.maven3.AbstractCommonMojo
-
- org.codehaus.cargo.maven3.AbstractCargoMojo
-
- org.codehaus.cargo.maven3.ContainerStartMojo
-
- org.codehaus.cargo.maven3.ContainerRunMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="run", requiresDependencyResolution=TEST, threadSafe=false) public class ContainerRunMojo extends ContainerStartMojo
Start a container using Cargo and wait until user pressed CTRL + C to stop.
-
-
Field Summary
-
Fields inherited from class org.codehaus.cargo.maven3.ContainerStartMojo
localContainer
-
Fields inherited from class org.codehaus.cargo.maven3.AbstractCargoMojo
CONTEXT_KEY_CLASSLOADER, CONTEXT_KEY_CONTAINER
-
-
Constructor Summary
Constructors Constructor Description ContainerRunMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Container
createNewContainer()
Creates a brand newContainer
instance.void
doExecute()
Executes the plugin.-
Methods inherited from class org.codehaus.cargo.maven3.ContainerStartMojo
addAutoDeployDeployable, executeLocalContainerAction
-
Methods inherited from class org.codehaus.cargo.maven3.AbstractCargoMojo
calculateArtifact, calculateContainerArtifactId, createAutoDeployDeployable, createConfiguration, createContainer, createDefaultContainerElementIfNecessary, createDefaultInstallerElementIfNecessary, createLogger, execute, getCargoProject, getConfigurationElement, getContainerElement, getDaemon, getDeployablesElement, getDeployerElement, isIgnoreFailures, setCargoProject, setConfigurationElement, setContainerElement, setDeployablesElement, setDeployerElement, setIgnoreFailures, waitDeployableMonitor
-
Methods inherited from class org.codehaus.cargo.maven3.AbstractCommonMojo
getProject
-
-
-
-
Method Detail
-
doExecute
public void doExecute() throws org.apache.maven.plugin.MojoExecutionException
Executes the plugin.This method must be implemented by all Mojos extending this class. The reason for this pattern is because we want the
AbstractCargoMojo.execute()
method to always be called so that necessary plugin initialization can be performed. Without this pattern Mojos extending this class could "forget" to callsuper.execute()
thus leading to unpredictible results.- Overrides:
doExecute
in classContainerStartMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
- in case of error
-
createNewContainer
protected Container createNewContainer() throws org.apache.maven.plugin.MojoExecutionException
Creates a brand newContainer
instance. If the user has not specified a container element in the POM file or if the user has not specified the container id then automatically create a default container (as defined inAbstractCargoMojo.createDefaultContainerElementIfNecessary()
) if the project calling this plugin has a WAR packaging. If the packaging is different then an exception is raised.- Overrides:
createNewContainer
in classAbstractCargoMojo
- Returns:
- a valid
Container
instance - Throws:
org.apache.maven.plugin.MojoExecutionException
- in case of error or if a default container could not be created
-
-