Class JettyRunMojo
- All Implemented Interfaces:
- org.apache.maven.plugin.ContextEnabled,- org.apache.maven.plugin.Mojo
The plugin runs a parallel lifecycle to ensure that the "test-compile" phase has been completed before invoking Jetty. This means that you do not need to explicity execute a "mvn compile" first. It also means that a "mvn clean jetty:run" will ensure that a full fresh compile is done before invoking Jetty.
Once invoked, the plugin can be configured to run continuously, scanning for changes in the project and automatically performing a hot redeploy when necessary. This allows the developer to concentrate on coding changes to the project using their IDE of choice and have those changes immediately and transparently reflected in the running web container, eliminating development time that is wasted on rebuilding, reassembling and redeploying. Alternatively, you can configure the plugin to wait for an <enter> at the command line to manually control redeployment.
You can configure this goal to run your unassembled webapp either in-process with maven, or forked into a new process, or deployed into a jetty distribution.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.jetty.maven.plugin.AbstractWebAppMojoAbstractWebAppMojo.DeploymentMode
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected JettyEmbedderOnly one of the following will be used, depending the mode the mojo is started in: EMBED, FORK, EXTERNALprotected JettyForkerprotected JettyHomeForkerprotected intControls redeployment of the webapp.protected ScannerScanner to check for files changes to cause redeployFields inherited from class org.eclipse.jetty.maven.plugin.AbstractUnassembledWebAppMojoclassesDirectory, scanClassesPattern, scanTestClassesPattern, testClassesDirectory, webAppSourceDirectory, webXmlFields inherited from class org.eclipse.jetty.maven.plugin.AbstractWebAppMojocontextHandlers, 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, webAppFields inherited from interface org.apache.maven.plugin.MojoROLE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidvoidexecute()voidvoidrestartWebApp(boolean reconfigure) Stop an executing webapp and restart it after optionally reconfiguring it.voidvoidvoidMethods inherited from class org.eclipse.jetty.maven.plugin.AbstractUnassembledWebAppMojoconfigureUnassembledWebApp, configureWebApp, getWebInfLibArtifacts, verifyPomConfigurationMethods inherited from class org.eclipse.jetty.maven.plugin.AbstractWebAppMojoaugmentPluginClasspath, configureScanTargetPatterns, configureSystemProperties, findJettyWebXmlFile, getContainerClassPath, getJettyOutputFile, getProjectName, getProvidedJars, isExcludedGoal, isPackagingSupported, isPluginArtifact, mergeSystemProperties, newJettyEmbedder, newJettyForker, newJettyHomeForker, startJettyMethods inherited from class org.apache.maven.plugin.AbstractMojogetLog, getPluginContext, setLog, setPluginContext
- 
Field Details- 
scan@Parameter(defaultValue="-1", property="jetty.scan", required=true) protected int scanControls redeployment of the webapp.- -1 : means no redeployment will be done
- 0 : means redeployment only occurs if you hit the ENTER key
- otherwise, the interval in seconds to pause before checking and redeploying if necessary
 
- 
scannerScanner to check for files changes to cause redeploy
- 
embedderOnly one of the following will be used, depending the mode the mojo is started in: EMBED, FORK, EXTERNAL
- 
forker
- 
homeForker
 
- 
- 
Constructor Details- 
JettyRunMojopublic JettyRunMojo()
 
- 
- 
Method Details- 
executepublic void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Specified by:
- executein interface- org.apache.maven.plugin.Mojo
- Overrides:
- executein class- AbstractWebAppMojo
- Throws:
- org.apache.maven.plugin.MojoExecutionException
- org.apache.maven.plugin.MojoFailureException
 
- 
startJettyEmbeddedpublic void startJettyEmbedded() throws org.apache.maven.plugin.MojoExecutionException- Specified by:
- startJettyEmbeddedin class- AbstractWebAppMojo
- Throws:
- org.apache.maven.plugin.MojoExecutionException
 
- 
startJettyForkedpublic void startJettyForked() throws org.apache.maven.plugin.MojoExecutionException- Specified by:
- startJettyForkedin class- AbstractWebAppMojo
- Throws:
- org.apache.maven.plugin.MojoExecutionException
 
- 
startJettyHomepublic void startJettyHome() throws org.apache.maven.plugin.MojoExecutionException- Specified by:
- startJettyHomein class- AbstractWebAppMojo
- Throws:
- org.apache.maven.plugin.MojoExecutionException
 
- 
configureScannerprotected void configureScanner() throws org.apache.maven.plugin.MojoExecutionException- Throws:
- org.apache.maven.plugin.MojoExecutionException
 
- 
gatherScannables- Throws:
- Exception
 
- 
restartWebAppStop an executing webapp and restart it after optionally reconfiguring it.- Parameters:
- reconfigure- if true, the scanner will be reconfigured after changes to the pom. If false, only the webapp will be reconfigured.
- Throws:
- Exception
 
 
-