public abstract class AbstractJettyMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
protected org.eclipse.jetty.server.Connector[] |
connectors
List of connectors to use.
|
protected Thread |
consoleScanner
A scanner to check ENTER hits on the console
|
protected org.eclipse.jetty.server.handler.ContextHandler[] |
contextHandlers
List of other contexts to set up.
|
protected String |
contextPath
Deprecated.
Use <webApp><contextPath> instead.
|
protected String |
contextXml
Location of a context xml configuration file whose contents
will be applied to the webapp AFTER anything in <webApp>.Optional.
|
protected boolean |
daemon
Determines whether or not the server blocks when started.
|
protected String[] |
excludedGoals
List of goals that are NOT to be used
|
protected String |
jettyXml
Comma separated list of a jetty xml configuration files whose contents
will be applied before any plugin configuration.
|
protected org.eclipse.jetty.security.LoginService[] |
loginServices
List of security realms to set up.
|
String |
PORT_SYSPROPERTY |
protected org.apache.maven.project.MavenProject |
project
The maven project.
|
protected Set |
projectArtifacts
The artifacts for the project.
|
protected String |
reload
reload can be set to either 'automatic' or 'manual'
if 'manual' then the context can be reloaded by a linefeed in the console
if 'automatic' then traditional reloading on changed files is enabled.
|
protected org.eclipse.jetty.server.RequestLog |
requestLog
A RequestLog implementation to use for the webapp at runtime.
|
protected int |
scanIntervalSeconds
The interval in seconds to scan the webapp for changes
and restart the context if necessary.
|
protected ArrayList<File> |
scanList
List of files and directories to scan
|
protected org.eclipse.jetty.util.Scanner |
scanner
A scanner to check for changes to the webapp
|
protected ArrayList<org.eclipse.jetty.util.Scanner.BulkListener> |
scannerListeners
List of Listeners for the scanner
|
protected JettyServer |
server
A wrapper for the Server object
|
protected boolean |
skip
Skip this mojo execution.
|
protected String |
stopKey
Key to provide when stopping jetty on executing java -DSTOP.KEY=<stopKey>
-DSTOP.PORT=<stopPort> -jar start.jar --stop
|
protected int |
stopPort
Port to listen to stop jetty on executing -DSTOP.PORT=<stopPort>
-DSTOP.KEY=<stopKey> -jar start.jar --stop
|
protected SystemProperties |
systemProperties
System properties to set before execution.
|
protected File |
systemPropertiesFile
File containing system properties to be set before execution
Note that these properties will NOT override System properties
that have been set on the command line, by the JVM, or directly
in the POM via systemProperties.
|
protected File |
tmpDirectory
Deprecated.
Use %lt;webApp><tempDirectory> instead.
|
protected boolean |
useProvidedScope
Whether or not to include dependencies on the plugin's classpath with <scope>provided</scope>
Use WITH CAUTION as you may wind up with duplicate jars/classes.
|
protected JettyWebAppContext |
webApp
An instance of org.eclipse.jetty.webapp.WebAppContext that represents the webapp.
|
| Constructor and Description |
|---|
AbstractJettyMojo() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyJettyXml() |
abstract void |
checkPomConfiguration() |
void |
configurePluginClasspath() |
abstract void |
configureScanner() |
void |
configureWebApplication()
Subclasses should invoke this to setup basic info
on the webapp
|
void |
execute() |
File |
findJettyWebXmlFile(File webInfDir)
Try and find a jetty-web.xml file, using some
historical naming conventions if necessary.
|
void |
finishConfigurationBeforeStart() |
org.eclipse.jetty.server.Connector[] |
getConnectors() |
org.eclipse.jetty.server.handler.ContextHandler[] |
getContextHandlers() |
String |
getContextPath() |
String |
getJettyConfig() |
List<File> |
getJettyXmlFiles() |
org.eclipse.jetty.security.LoginService[] |
getLoginServices() |
List |
getPluginArtifacts() |
org.apache.maven.project.MavenProject |
getProject() |
String |
getReload() |
org.eclipse.jetty.server.RequestLog |
getRequestLog() |
int |
getScanIntervalSeconds() |
ArrayList<File> |
getScanList() |
org.eclipse.jetty.util.Scanner |
getScanner() |
ArrayList |
getScannerListeners() |
JettyServer |
getServer() |
String |
getStopKey() |
int |
getStopPort() |
SystemProperties |
getSystemProperties() |
File |
getSystemPropertiesFile() |
File |
getTmpDirectory() |
JettyWebAppContext |
getWebAppConfig() |
String |
getWebAppXml() |
boolean |
isDaemon() |
boolean |
isExcluded(String goal) |
boolean |
isPluginArtifact(org.apache.maven.artifact.Artifact artifact) |
boolean |
isSkip() |
abstract void |
restartWebApp(boolean reconfigureScanner) |
void |
setConnectors(org.eclipse.jetty.server.Connector[] connectors) |
void |
setContextHandlers(org.eclipse.jetty.server.handler.ContextHandler[] contextHandlers) |
void |
setContextPath(String contextPath) |
void |
setDaemon(boolean daemon) |
void |
setJettyConfig(String jettyConfig) |
void |
setLoginServices(org.eclipse.jetty.security.LoginService[] loginServices) |
void |
setPluginArtifacts(List pluginArtifacts) |
void |
setProject(org.apache.maven.project.MavenProject project) |
void |
setReload(String reload) |
void |
setRequestLog(org.eclipse.jetty.server.RequestLog requestLog) |
void |
setScanIntervalSeconds(int scanIntervalSeconds) |
void |
setScanList(ArrayList<File> list) |
void |
setScannerListeners(ArrayList<org.eclipse.jetty.util.Scanner.BulkListener> listeners) |
void |
setServer(JettyServer server) |
void |
setSkip(boolean skip) |
void |
setStopKey(String stopKey) |
void |
setStopPort(int stopPort) |
void |
setSystemProperties(SystemProperties systemProperties) |
void |
setSystemPropertiesFile(File file) |
void |
setTmpDirectory(File tmpDirectory) |
void |
setWebAppConfig(JettyWebAppContext webAppConfig) |
void |
setWebAppXml(String webAppXml) |
protected void |
startConsoleScanner()
Run a thread that monitors the console input to detect ENTER hits.
|
void |
startJetty() |
protected boolean useProvidedScope
protected String[] excludedGoals
protected org.eclipse.jetty.server.Connector[] connectors
protected org.eclipse.jetty.server.handler.ContextHandler[] contextHandlers
protected org.eclipse.jetty.security.LoginService[] loginServices
protected org.eclipse.jetty.server.RequestLog requestLog
protected JettyWebAppContext webApp
protected String contextPath
protected File tmpDirectory
protected int scanIntervalSeconds
protected String reload
protected File systemPropertiesFile
protected SystemProperties systemProperties
protected String jettyXml
protected int stopPort
protected String stopKey
protected boolean daemon
Determines whether or not the server blocks when started. The default behavior (daemon = false) will cause the server to pause other processes while it continues to handle web requests. This is useful when starting the server with the intent to work with it interactively.
Often, it is desirable to let the server start and continue running subsequent processes in an automated build environment. This can be facilitated by setting daemon to true.
protected boolean skip
protected String contextXml
protected org.apache.maven.project.MavenProject project
protected Set projectArtifacts
protected JettyServer server
protected org.eclipse.jetty.util.Scanner scanner
protected ArrayList<org.eclipse.jetty.util.Scanner.BulkListener> scannerListeners
protected Thread consoleScanner
public String PORT_SYSPROPERTY
public abstract void restartWebApp(boolean reconfigureScanner)
throws Exception
Exceptionpublic abstract void checkPomConfiguration()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic abstract void configureScanner()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionpublic void configurePluginClasspath()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic boolean isPluginArtifact(org.apache.maven.artifact.Artifact artifact)
public void finishConfigurationBeforeStart()
throws Exception
Exceptionpublic void startJetty()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void configureWebApplication()
throws Exception
org.apache.maven.plugin.MojoExecutionExceptionExceptionprotected void startConsoleScanner()
throws Exception
Exceptionpublic File findJettyWebXmlFile(File webInfDir)
webInfDir - public org.eclipse.jetty.util.Scanner getScanner()
public org.apache.maven.project.MavenProject getProject()
public void setProject(org.apache.maven.project.MavenProject project)
public File getTmpDirectory()
public void setTmpDirectory(File tmpDirectory)
public String getContextPath()
public void setContextPath(String contextPath)
public int getScanIntervalSeconds()
public void setScanIntervalSeconds(int scanIntervalSeconds)
public File getSystemPropertiesFile()
public void setSystemPropertiesFile(File file) throws Exception
Exceptionpublic void setSystemProperties(SystemProperties systemProperties)
public SystemProperties getSystemProperties()
public JettyServer getServer()
public void setServer(JettyServer server)
public void setScannerListeners(ArrayList<org.eclipse.jetty.util.Scanner.BulkListener> listeners)
public ArrayList getScannerListeners()
public JettyWebAppContext getWebAppConfig()
public void setWebAppConfig(JettyWebAppContext webAppConfig)
public org.eclipse.jetty.server.RequestLog getRequestLog()
public void setRequestLog(org.eclipse.jetty.server.RequestLog requestLog)
public org.eclipse.jetty.security.LoginService[] getLoginServices()
public void setLoginServices(org.eclipse.jetty.security.LoginService[] loginServices)
public org.eclipse.jetty.server.handler.ContextHandler[] getContextHandlers()
public void setContextHandlers(org.eclipse.jetty.server.handler.ContextHandler[] contextHandlers)
public org.eclipse.jetty.server.Connector[] getConnectors()
public void setConnectors(org.eclipse.jetty.server.Connector[] connectors)
public String getReload()
public void setReload(String reload)
public String getJettyConfig()
public void setJettyConfig(String jettyConfig)
public String getWebAppXml()
public void setWebAppXml(String webAppXml)
public boolean isSkip()
public void setSkip(boolean skip)
public boolean isDaemon()
public void setDaemon(boolean daemon)
public String getStopKey()
public void setStopKey(String stopKey)
public int getStopPort()
public void setStopPort(int stopPort)
public List getPluginArtifacts()
public void setPluginArtifacts(List pluginArtifacts)
public boolean isExcluded(String goal)
Copyright © 1995-2014 Mort Bay Consulting. All Rights Reserved.