Class AbstractRunMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    RunMojo, StartMojo

    public abstract class AbstractRunMojo
    extends AbstractDependencyFilterMojo
    Base class to run a spring application.
    Author:
    Phillip Webb, Stephane Nicoll, David Liu, Daniel Young
    See Also:
    RunMojo, StartMojo
    • Field Summary

      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractRunMojo()  
    • Method Summary

      Modifier and Type Method Description
      void execute()  
      protected java.net.URL[] getClassPathUrls()  
      protected boolean isFork()
      Specify if the application process should be forked.
      protected io.joshworks.snappy.maven.RunArguments resolveApplicationArguments()
      Resolve the application arguments to use.
      protected io.joshworks.snappy.maven.RunArguments resolveJvmArguments()
      Resolve the JVM arguments to use.
      protected abstract void runWithForkedJvm​(java.util.List<java.lang.String> args)
      Run with a forked VM, using the specified command line arguments.
      protected abstract void runWithMavenJvm​(java.lang.String startClassName, java.lang.String... arguments)
      Run with the current VM, using the specified arguments.
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractRunMojo

        public AbstractRunMojo()
    • Method Detail

      • isFork

        protected boolean isFork()
        Specify if the application process should be forked.
        Returns:
        true if the application process should be forked
      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • runWithForkedJvm

        protected abstract void runWithForkedJvm​(java.util.List<java.lang.String> args)
                                          throws org.apache.maven.plugin.MojoExecutionException,
                                                 org.apache.maven.plugin.MojoFailureException
        Run with a forked VM, using the specified command line arguments.
        Parameters:
        args - the arguments (JVM arguments and application arguments)
        Throws:
        org.apache.maven.plugin.MojoExecutionException - in case of MOJO execution errors
        org.apache.maven.plugin.MojoFailureException - in case of MOJO failures
      • runWithMavenJvm

        protected abstract void runWithMavenJvm​(java.lang.String startClassName,
                                                java.lang.String... arguments)
                                         throws org.apache.maven.plugin.MojoExecutionException,
                                                org.apache.maven.plugin.MojoFailureException
        Run with the current VM, using the specified arguments.
        Parameters:
        startClassName - the class to run
        arguments - the class arguments
        Throws:
        org.apache.maven.plugin.MojoExecutionException - in case of MOJO execution errors
        org.apache.maven.plugin.MojoFailureException - in case of MOJO failures
      • resolveApplicationArguments

        protected io.joshworks.snappy.maven.RunArguments resolveApplicationArguments()
        Resolve the application arguments to use.
        Returns:
        a RunArguments defining the application arguments
      • resolveJvmArguments

        protected io.joshworks.snappy.maven.RunArguments resolveJvmArguments()
        Resolve the JVM arguments to use.
        Returns:
        a RunArguments defining the JVM arguments
      • getClassPathUrls

        protected java.net.URL[] getClassPathUrls()
                                           throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException