Class JettyRunForkedMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="run-forked",
          requiresDependencyResolution=TEST)
    @Execute(phase=TEST_COMPILE)
    public class JettyRunForkedMojo
    extends JettyRunMojo
    This goal is used to deploy your unassembled webapp into a forked JVM.

    You need to define a jetty.xml file to configure connectors etc. You can use the normal setters of o.e.j.webapp.WebAppContext on the webApp configuration element for this plugin. You may also need context xml file for any particularly complex webapp setup.

    Unlike the other jetty goals, this does NOT support the scanIntervalSeconds parameter: the webapp will be deployed only once.

    The stopKey, stopPort configuration elements can be used to control the stopping of the forked process. By default, this plugin will launch the forked jetty instance and wait for it to complete (in which case it acts much like the jetty:run goal, and you will need to Cntrl-C to stop). By setting the configuration element waitForChild to false, the plugin will terminate after having forked the jetty process. In this case you can use the jetty:stop goal to terminate the process.

    See https://jetty.org/docs/ for more information on this and other jetty plugins. Runs Jetty in forked JVM on an unassembled webapp

    • Field Detail

      • target

        @Parameter(defaultValue="${project.build.directory}",
                   readonly=true,
                   required=true)
        protected java.io.File target
        The target directory
      • forkWebXml

        @Parameter(defaultValue="${project.build.directory}/fork-web.xml")
        protected java.io.File forkWebXml
        The file into which to generate the quickstart web xml for the forked process to use
    • Constructor Detail

      • JettyRunForkedMojo

        public JettyRunForkedMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Specified by:
        execute in interface org.apache.maven.plugin.Mojo
        Overrides:
        execute in class JettyRunMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
        See Also:
        Mojo.execute()
      • startJetty

        public void startJetty()
                        throws org.apache.maven.plugin.MojoExecutionException
        Overrides:
        startJetty in class AbstractJettyMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getProvidedJars

        public java.util.List<java.lang.String> getProvidedJars()
                                                         throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • prepareConfiguration

        public java.io.File prepareConfiguration()
                                          throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getContainerClassPath

        public java.lang.String getContainerClassPath()
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • pathSeparators

        public static java.lang.String pathSeparators​(java.lang.String path)