public class JettyRunMojo extends AbstractCipangoMojo
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 |
|---|---|
protected java.io.File |
classesDirectory
The directory containing generated classes.
|
static java.lang.String |
DEFAULT_WEBAPP_SRC |
protected java.util.List<java.io.File> |
extraScanTargets
Extra scan targets as a list
|
static java.lang.String |
FAKE_WEBAPP |
protected ScanTargetPattern[] |
scanTargetPatterns
List of directories with ant-style <include> and <exclude> patterns
for extra targets to periodically scan for changes.
|
protected java.io.File[] |
scanTargets
List of files or directories to additionally periodically scan for changes.
|
protected java.io.File |
testClassesDirectory
The directory containing generated test classes.
|
protected boolean |
useTestScope
If true, the <testOutputDirectory>
and the dependencies of <scope>test<scope>
will be put first on the runtime classpath.
|
protected java.util.List<org.apache.maven.artifact.Artifact> |
warArtifacts
List of deps that are wars
|
protected WarPluginInfo |
warPluginInfo
maven-war-plugin reference
|
protected java.io.File |
webAppSourceDirectory
Root directory for all html/jsp etc files
|
protected java.lang.String |
webXml
The default location of the web.xml file.
|
addDefaultConnectors, annotationsEnabled, extraConfigurationClasses, SIP_HOST_PROPERTY, SIP_PORT_PROPERTY, sipApp, sipDefaultXmlconsoleScanner, contextHandlers, contextXml, daemon, dumpOnStart, excludedGoals, execution, httpConnector, jettyXml, loginServices, pluginArtifacts, PORT_SYSPROPERTY, project, projectArtifacts, reload, requestLog, scanIntervalSeconds, scanList, scanner, scannerListeners, server, skip, stopKey, stopPort, systemProperties, systemPropertiesFile, 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() |
protected org.apache.maven.artifact.Artifact |
getArtifactForOverlay(OverlayConfig o,
java.util.List<org.apache.maven.artifact.Artifact> warArtifacts) |
void |
restartWebApp(boolean reconfigureScanner) |
applyJettyXml, finishConfigurationBeforeStartconfigurePluginClasspath, findJettyWebXmlFile, getJettyXmlFiles, isExcluded, isPluginArtifact, setSystemProperties, setSystemPropertiesFile, startConsoleScanner, startJettypublic static final java.lang.String DEFAULT_WEBAPP_SRC
public static final java.lang.String FAKE_WEBAPP
protected boolean useTestScope
protected java.lang.String webXml
protected java.io.File classesDirectory
protected java.io.File testClassesDirectory
protected java.io.File webAppSourceDirectory
protected java.io.File[] scanTargets
protected ScanTargetPattern[] scanTargetPatterns
protected java.util.List<java.io.File> extraScanTargets
protected WarPluginInfo warPluginInfo
protected java.util.List<org.apache.maven.artifact.Artifact> warArtifacts
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
execute in interface org.apache.maven.plugin.Mojoexecute in class AbstractCipangoMojoorg.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionAbstractJettyMojo.execute()public void checkPomConfiguration()
throws org.apache.maven.plugin.MojoExecutionException
checkPomConfiguration in class AbstractJettyMojoorg.apache.maven.plugin.MojoExecutionExceptionAbstractJettyMojo.checkPomConfiguration()public void configureWebApplication()
throws java.lang.Exception
AbstractJettyMojoconfigureWebApplication in class AbstractCipangoMojoorg.apache.maven.plugin.MojoExecutionExceptionjava.lang.ExceptionAbstractJettyMojo.configureWebApplication()public void configureScanner()
throws org.apache.maven.plugin.MojoExecutionException
configureScanner in class AbstractJettyMojoorg.apache.maven.plugin.MojoExecutionExceptionAbstractJettyMojo.configureScanner()public void restartWebApp(boolean reconfigureScanner)
throws java.lang.Exception
restartWebApp in class AbstractJettyMojojava.lang.ExceptionAbstractJettyMojo.restartWebApp(boolean)protected org.apache.maven.artifact.Artifact getArtifactForOverlay(OverlayConfig o, java.util.List<org.apache.maven.artifact.Artifact> warArtifacts)
o - warArtifacts - Copyright © 2015. All Rights Reserved.