Package org.eclipse.jetty.maven.plugin
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.maven.plugin.AbstractWebAppMojo
AbstractWebAppMojo.DeploymentMode
-
Field Summary
Modifier and TypeFieldDescriptionprotected JettyEmbedder
protected JettyForker
protected JettyHomeForker
protected int
The interval in seconds to pause before checking if changes have occurred and re-deploying as necessary.protected Scanner
Scanner to check for files changes to cause redeployprotected Path
Fields inherited from class org.eclipse.jetty.maven.plugin.AbstractWebAppMojo
contextHandlers, contextXml, deployMode, env, excludedGoals, execution, FAKE_WEBAPP, forkWebXml, httpConnector, JETTY_HOME_ARTIFACTID, JETTY_HOME_GROUPID, jettyBase, jettyHome, jettyOptions, jettyProperties, jettyXmls, jvmArgs, loginServices, mavenProjectHelper, maxChildStartCheckMs, maxChildStartChecks, mergedSystemProperties, modules, originalBaseResource, plugin, pluginArtifacts, project, projectArtifacts, providedJars, reactorProjects, requestLog, scanTargetPatterns, server, skip, stopKey, stopPort, supportedPackagings, systemProperties, systemPropertiesFile, target, useProvidedScope, useTestScope, warArtifacts, webApp
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Ensure there is a webapp, and that some basic defaults are applied if the user has not supplied them.void
restartWebApp
(boolean reconfigure) void
Start a jetty instance in process to run the built war.void
Fork a jetty instance to run the built war.void
Deploy the built war to a jetty distro.void
Methods inherited from class org.eclipse.jetty.maven.plugin.AbstractWebAppMojo
augmentPluginClasspath, configureScanTargetPatterns, configureSystemProperties, execute, findJettyWebXmlFile, getContainerClassPath, getJettyOutputFile, getProjectName, getProvidedJars, isExcludedGoal, isPackagingSupported, isPluginArtifact, mergeSystemProperties, newJettyEmbedder, newJettyForker, newJettyHomeForker, startJetty, verifyPomConfiguration
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
scan
@Parameter(defaultValue="0", property="jetty.scan", required=true) protected int scanThe 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
Scanner to check for files changes to cause redeploy -
embedder
-
forker
-
homeForker
-
war
-
-
Constructor Details
-
JettyRunWarMojo
public JettyRunWarMojo()
-
-
Method Details
-
configureWebApp
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 classAbstractWebAppMojo
- Throws:
Exception
-
startJettyEmbedded
public void startJettyEmbedded() throws org.apache.maven.plugin.MojoExecutionExceptionStart a jetty instance in process to run the built war.- Specified by:
startJettyEmbedded
in classAbstractWebAppMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
startJettyForked
public void startJettyForked() throws org.apache.maven.plugin.MojoExecutionExceptionFork a jetty instance to run the built war.- Specified by:
startJettyForked
in classAbstractWebAppMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
startJettyHome
public void startJettyHome() throws org.apache.maven.plugin.MojoExecutionExceptionDeploy the built war to a jetty distro.- Specified by:
startJettyHome
in classAbstractWebAppMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
startScanner
- Throws:
Exception
-
configureScanner
public void configureScanner() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
restartWebApp
- Throws:
Exception
-