public class JettyRunMojo extends AbstractJettyMojo
This goal is used in-situ on a Maven project without first requiring that the project is assembled into a war, saving time during the development cycle. The plugin forks a parallel lifecycle to ensure that the "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.
You may also specify the location of a jetty.xml file whose contents will be applied before any plugin configuration. This can be used, for example, to deploy a static webapp that is not part of your maven build.
There is a reference guide to the configuration parameters for this plugin, and more detailed information with examples in the Configuration Guide.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_WEBAPP_SRC |
connectors, consoleScanner, contextHandlers, contextPath, contextXml, daemon, excludedGoals, jettyXml, loginServices, PORT_SYSPROPERTY, project, projectArtifacts, reload, requestLog, scanIntervalSeconds, scanList, scanner, scannerListeners, server, skip, stopKey, stopPort, systemProperties, systemPropertiesFile, tmpDirectory, useProvidedScope, webApp| Constructor and Description |
|---|
JettyRunMojo() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkPomConfiguration()
Verify the configuration given in the pom.
|
void |
configureScanner() |
void |
configureWebApplication()
Subclasses should invoke this to setup basic info
on the webapp
|
void |
execute() |
File |
getClassesDirectory() |
List<File> |
getExtraScanTargets() |
ScanTargetPattern[] |
getScanTargetPatterns() |
File[] |
getScanTargets() |
File |
getTestClassesDirectory() |
File |
getWebAppSourceDirectory() |
String |
getWebXml() |
boolean |
isUseTestClasspath() |
void |
restartWebApp(boolean reconfigureScanner) |
void |
setClassesDirectory(File classesDirectory) |
void |
setExtraScanTargets(List<File> list) |
void |
setScanTargetPatterns(ScanTargetPattern[] scanTargetPatterns) |
void |
setScanTargets(File[] scanTargets) |
void |
setTestClassesDirectory(File testClassesDirectory) |
void |
setUseTestClasspath(boolean useTestClasspath) |
void |
setWebAppSourceDirectory(File webAppSourceDirectory) |
void |
setWebXml(String webXml) |
applyJettyXml, configurePluginClasspath, findJettyWebXmlFile, finishConfigurationBeforeStart, getConnectors, getContextHandlers, getContextPath, getJettyConfig, getJettyXmlFiles, getLoginServices, getPluginArtifacts, getProject, getReload, getRequestLog, getScanIntervalSeconds, getScanList, getScanner, getScannerListeners, getServer, getStopKey, getStopPort, getSystemProperties, getSystemPropertiesFile, getTmpDirectory, getWebAppConfig, getWebAppXml, isDaemon, isExcluded, isPluginArtifact, isSkip, setConnectors, setContextHandlers, setContextPath, setDaemon, setJettyConfig, setLoginServices, setPluginArtifacts, setProject, setReload, setRequestLog, setScanIntervalSeconds, setScanList, setScannerListeners, setServer, setSkip, setStopKey, setStopPort, setSystemProperties, setSystemPropertiesFile, setTmpDirectory, setWebAppConfig, setWebAppXml, startConsoleScanner, startJettypublic static final String DEFAULT_WEBAPP_SRC
public void checkPomConfiguration()
throws org.apache.maven.plugin.MojoExecutionException
checkPomConfiguration in class AbstractJettyMojoorg.apache.maven.plugin.MojoExecutionExceptionAbstractJettyMojo.checkPomConfiguration()public void configureWebApplication()
throws Exception
AbstractJettyMojoconfigureWebApplication in class AbstractJettyMojoorg.apache.maven.plugin.MojoExecutionExceptionExceptionpublic void configureScanner()
throws org.apache.maven.plugin.MojoExecutionException
configureScanner in class AbstractJettyMojoorg.apache.maven.plugin.MojoExecutionExceptionpublic void restartWebApp(boolean reconfigureScanner)
throws Exception
restartWebApp in class AbstractJettyMojoExceptionpublic void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
execute in interface org.apache.maven.plugin.Mojoexecute in class AbstractJettyMojoorg.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionpublic String getWebXml()
public void setWebXml(String webXml)
public File getClassesDirectory()
public void setClassesDirectory(File classesDirectory)
public File getWebAppSourceDirectory()
public void setWebAppSourceDirectory(File webAppSourceDirectory)
public boolean isUseTestClasspath()
public void setUseTestClasspath(boolean useTestClasspath)
public File getTestClassesDirectory()
public void setTestClassesDirectory(File testClassesDirectory)
public File[] getScanTargets()
public void setScanTargets(File[] scanTargets)
public ScanTargetPattern[] getScanTargetPatterns()
public void setScanTargetPatterns(ScanTargetPattern[] scanTargetPatterns)
Copyright © 1995-2014 Mort Bay Consulting. All Rights Reserved.