Class 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.
    • Constructor Detail

      • ContainerRunMojo

        public ContainerRunMojo()
    • 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 call super.execute() thus leading to unpredictible results.

        Overrides:
        doExecute in class ContainerStartMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException - in case of error
      • createNewContainer

        protected Container createNewContainer()
                                        throws org.apache.maven.plugin.MojoExecutionException
        Creates a brand new Container 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 in AbstractCargoMojo.createDefaultContainerElementIfNecessary()) if the project calling this plugin has a WAR packaging. If the packaging is different then an exception is raised.
        Overrides:
        createNewContainer in class AbstractCargoMojo
        Returns:
        a valid Container instance
        Throws:
        org.apache.maven.plugin.MojoExecutionException - in case of error or if a default container could not be created