org.mortbay.jetty.plugin
Class JettyRunMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.mortbay.jetty.plugin.AbstractJettyMojo
org.mortbay.jetty.plugin.JettyRunMojo
- All Implemented Interfaces:
- org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
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.
Fields inherited from class org.mortbay.jetty.plugin.AbstractJettyMojo |
connectors, consoleScanner, contextHandlers, contextPath, daemon, jettyConfig, loginServices, PORT_SYSPROPERTY, project, reload, requestLog, scanIntervalSeconds, scanList, scanner, scannerListeners, server, skip, stopKey, stopPort, systemProperties, systemPropertiesFile, tmpDirectory, webAppConfig, webAppXml |
Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
Methods inherited from class org.mortbay.jetty.plugin.AbstractJettyMojo |
findJettyWebXmlFile, getContextPath, getJettyXmlFile, getProject, getScanIntervalSeconds, getScanList, getScanner, getScannerListeners, getServer, getSystemPropertiesFile, getTmpDirectory, setScanList, setScannerListeners, setServer, setSystemProperties, setSystemPropertiesFile, startConsoleScanner, startJetty |
Methods inherited from class org.apache.maven.plugin.AbstractMojo |
getLog, getPluginContext, setLog, setPluginContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JettyRunMojo
public JettyRunMojo()
getWebXml
public java.lang.String getWebXml()
getClassesDirectory
public java.io.File getClassesDirectory()
getWebAppSourceDirectory
public java.io.File getWebAppSourceDirectory()
setClassPathFiles
public void setClassPathFiles(java.util.List<java.io.File> list)
getClassPathFiles
public java.util.List<java.io.File> getClassPathFiles()
getExtraScanTargets
public java.util.List<java.io.File> getExtraScanTargets()
setExtraScanTargets
public void setExtraScanTargets(java.util.List<java.io.File> list)
checkPomConfiguration
public void checkPomConfiguration()
throws org.apache.maven.plugin.MojoExecutionException
- Verify the configuration given in the pom.
- Specified by:
checkPomConfiguration
in class AbstractJettyMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
- See Also:
AbstractJettyMojo.checkPomConfiguration()
configureWebApplication
public void configureWebApplication()
throws java.lang.Exception
- Description copied from class:
AbstractJettyMojo
- Subclasses should invoke this to setup basic info
on the webapp
- Overrides:
configureWebApplication
in class AbstractJettyMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
java.lang.Exception
configureScanner
public void configureScanner()
throws org.apache.maven.plugin.MojoExecutionException
- Specified by:
configureScanner
in class AbstractJettyMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
restartWebApp
public void restartWebApp(boolean reconfigureScanner)
throws java.lang.Exception
- Specified by:
restartWebApp
in class AbstractJettyMojo
- Throws:
java.lang.Exception
finishConfigurationBeforeStart
public void finishConfigurationBeforeStart()
throws java.lang.Exception
- Specified by:
finishConfigurationBeforeStart
in class AbstractJettyMojo
- Throws:
java.lang.Exception
applyJettyXml
public void applyJettyXml()
throws java.lang.Exception
- Specified by:
applyJettyXml
in class AbstractJettyMojo
- Throws:
java.lang.Exception
execute
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
- Specified by:
execute
in interface org.apache.maven.plugin.Mojo
- Overrides:
execute
in class AbstractJettyMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.