Class JettyRunWarMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.eclipse.jetty.maven.plugin.AbstractWebAppMojo
org.eclipse.jetty.maven.plugin.JettyRunWarMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="run-war", requiresDependencyResolution=COMPILE_PLUS_RUNTIME) @Execute(phase=PACKAGE) public class JettyRunWarMojo extends AbstractWebAppMojo

This goal is used to assemble your webapp into a war and automatically deploy it to Jetty.

Once invoked, the plugin runs continuously and can be configured to scan for changes in the project and to the war file and automatically perform a hot redeploy when necessary.

You may also specify the location of a jetty.xml file whose contents will be applied before any plugin configuration.

You can configure this goal to run your webapp either in-process with maven, or forked into a new process, or deployed into a jetty distribution.

  • Field Details

    • scan

      @Parameter(defaultValue="0", property="jetty.scan", required=true) protected int scan
      The interval in seconds to pause before checking if changes have occurred and re-deploying as necessary. A value of 0 indicates no re-deployment will be done. In that case, you can force redeployment by typing a linefeed character at the command line.
    • scanner

      protected Scanner scanner
      Scanner to check for files changes to cause redeploy
    • embedder

      protected JettyEmbedder embedder
    • forker

      protected JettyForker forker
    • homeForker

      protected JettyHomeForker homeForker
    • war

      protected Path war
  • Constructor Details

    • JettyRunWarMojo

      public JettyRunWarMojo()
  • Method Details

    • configureWebApp

      public void configureWebApp() throws Exception
      Description copied from class: AbstractWebAppMojo
      Ensure there is a webapp, and that some basic defaults are applied if the user has not supplied them.
      Overrides:
      configureWebApp in class AbstractWebAppMojo
      Throws:
      Exception
    • startJettyEmbedded

      public void startJettyEmbedded() throws org.apache.maven.plugin.MojoExecutionException
      Start a jetty instance in process to run the built war.
      Specified by:
      startJettyEmbedded in class AbstractWebAppMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • startJettyForked

      public void startJettyForked() throws org.apache.maven.plugin.MojoExecutionException
      Fork a jetty instance to run the built war.
      Specified by:
      startJettyForked in class AbstractWebAppMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • startJettyHome

      public void startJettyHome() throws org.apache.maven.plugin.MojoExecutionException
      Deploy the built war to a jetty distro.
      Specified by:
      startJettyHome in class AbstractWebAppMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • startScanner

      public void startScanner() throws Exception
      Throws:
      Exception
    • configureScanner

      public void configureScanner() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • restartWebApp

      public void restartWebApp(boolean reconfigure) throws Exception
      Throws:
      Exception