public class JettyRun extends AbstractJettyRunTask
Deploys an exploded web application to an embedded Jetty web container. Does not require that the web application be assembled into a war, saving time during the development cycle.
Once started, the web container 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.
Task.NamerconsoleScanner, PORT_SYSPROPERTY, reload, scannerListenersTASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE| Constructor and Description |
|---|
JettyRun() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyJettyXml() |
void |
configureScanner() |
void |
configureWebApplication()
Subclasses should invoke this to setup basic info on the webapp.
|
org.gradle.api.plugins.jetty.internal.JettyPluginServer |
createServer()
create a proxy that wraps a particular jetty version Server object.
|
void |
finishConfigurationBeforeStart() |
FileCollection |
getClasspath()
Returns the classpath for the web application.
|
List<File> |
getClassPathFiles() |
org.mortbay.jetty.handler.ContextHandler[] |
getConfiguredContextHandlers() |
Set<File> |
getExtraScanTargets() |
File |
getJettyEnvXml() |
File |
getJettyEnvXmlFile() |
ScanTargetPattern[] |
getScanTargetPatterns() |
File[] |
getScanTargets() |
File |
getWebAppSourceDirectory()
Returns the directory containing the web application source files.
|
File |
getWebXml()
Returns the
web.xml file to use. |
void |
restartWebApp(boolean reconfigureScanner) |
void |
setClasspath(FileCollection classpath)
Set the classpath for the web application.
|
void |
setClassPathFiles(List<File> classPathFiles) |
void |
setContextHandlers(org.mortbay.jetty.handler.ContextHandler[] contextHandlers) |
void |
setExtraScanTargets(Iterable<File> extraScanTargets) |
void |
setJettyEnvXml(File jettyEnvXml) |
void |
setJettyEnvXmlFile(File jettyEnvXmlFile) |
void |
setScanTargetPatterns(ScanTargetPattern[] scanTargetPatterns) |
void |
setScanTargets(File[] scanTargets) |
void |
setWebAppSourceDirectory(File webAppSourceDirectory) |
void |
setWebXml(File webXml) |
void |
validateConfiguration() |
findJettyWebXmlFile, getAdditionalRuntimeJars, getConnectors, getContextPath, getHttpPort, getJettyConfig, getOverrideWebXml, getReload, getRequestLog, getScanIntervalSeconds, getScanner, getScannerListeners, getServer, getStopKey, getStopPort, getUserRealms, getWebAppConfig, getWebDefaultXml, isDaemon, setAdditionalRuntimeJars, setConnectors, setContextPath, setDaemon, setHttpPort, setJettyConfig, setOverrideWebXml, setReload, setRequestLog, setScanIntervalSeconds, setScannerListeners, setServer, setStopKey, setStopPort, setUserRealms, setWebAppConfig, setWebDefaultXml, start, startConsoleScanner, startJetty, startJettyInternalconventionMapping, conventionMapping, getConventionMappingaddValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setName, setOnlyIf, setOnlyIf, setProject, setProperty, setShouldRunAfter, shouldRunAfter, toStringpublic void validateConfiguration()
validateConfiguration in class AbstractJettyRunTaskpublic void configureWebApplication()
throws Exception
AbstractJettyRunTaskconfigureWebApplication in class AbstractJettyRunTaskExceptionpublic void configureScanner()
configureScanner in class AbstractJettyRunTaskpublic void restartWebApp(boolean reconfigureScanner)
throws Exception
restartWebApp in class AbstractJettyRunTaskExceptionpublic void finishConfigurationBeforeStart()
throws Exception
finishConfigurationBeforeStart in class AbstractJettyRunTaskExceptionpublic void applyJettyXml()
throws Exception
applyJettyXml in class AbstractJettyRunTaskExceptionpublic org.gradle.api.plugins.jetty.internal.JettyPluginServer createServer()
AbstractJettyRunTaskcreateServer in class AbstractJettyRunTask@InputFile @Optional public File getJettyEnvXml()
public void setJettyEnvXml(File jettyEnvXml)
public File getWebXml()
web.xml file to use. When null, no web.xml file is used.public void setWebXml(File webXml)
@InputDirectory public File getWebAppSourceDirectory()
public void setWebAppSourceDirectory(File webAppSourceDirectory)
public File[] getScanTargets()
public void setScanTargets(File[] scanTargets)
@InputFile @Optional public File getJettyEnvXmlFile()
public void setJettyEnvXmlFile(File jettyEnvXmlFile)
public ScanTargetPattern[] getScanTargetPatterns()
public void setScanTargetPatterns(ScanTargetPattern[] scanTargetPatterns)
public org.mortbay.jetty.handler.ContextHandler[] getConfiguredContextHandlers()
public void setContextHandlers(org.mortbay.jetty.handler.ContextHandler[] contextHandlers)
@InputFiles public FileCollection getClasspath()
public void setClasspath(FileCollection classpath)