public abstract class AbstractJettyMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.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 java.lang.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 boolean |
dumpOnStart
Use the dump() facility of jetty to print out the server configuration to logging
|
protected java.lang.String[] |
excludedGoals
List of goals that are NOT to be used
|
protected org.apache.maven.plugin.MojoExecution |
execution |
protected MavenServerConnector |
httpConnector
A ServerConnector to use.
|
protected java.lang.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.
|
protected java.util.List |
pluginArtifacts
The artifacts for the plugin itself.
|
java.lang.String |
PORT_SYSPROPERTY |
protected org.apache.maven.project.MavenProject |
project
The maven project.
|
protected java.util.Set |
projectArtifacts
The artifacts for the project.
|
protected java.lang.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 java.util.ArrayList<java.io.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 java.util.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 java.lang.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 java.io.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 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() |
java.io.File |
findJettyWebXmlFile(java.io.File webInfDir)
Try and find a jetty-web.xml file, using some
historical naming conventions if necessary.
|
void |
finishConfigurationBeforeStart() |
java.util.List<java.io.File> |
getJettyXmlFiles() |
boolean |
isExcluded(java.lang.String goal) |
boolean |
isPluginArtifact(org.apache.maven.artifact.Artifact artifact) |
abstract void |
restartWebApp(boolean reconfigureScanner) |
void |
setSystemProperties(SystemProperties systemProperties) |
void |
setSystemPropertiesFile(java.io.File file) |
protected void |
startConsoleScanner()
Run a thread that monitors the console input to detect ENTER hits.
|
void |
startJetty() |
public java.lang.String PORT_SYSPROPERTY
protected boolean useProvidedScope
protected java.lang.String[] excludedGoals
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 int scanIntervalSeconds
protected java.lang.String reload
protected java.io.File systemPropertiesFile
protected SystemProperties systemProperties
protected java.lang.String jettyXml
protected int stopPort
protected java.lang.String stopKey
protected boolean dumpOnStart
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 java.lang.String contextXml
protected org.apache.maven.project.MavenProject project
protected java.util.Set projectArtifacts
protected org.apache.maven.plugin.MojoExecution execution
protected java.util.List pluginArtifacts
protected MavenServerConnector httpConnector
protected JettyServer server
protected org.eclipse.jetty.util.Scanner scanner
protected java.util.ArrayList<java.io.File> scanList
protected java.util.ArrayList<org.eclipse.jetty.util.Scanner.BulkListener> scannerListeners
protected java.lang.Thread consoleScanner
public abstract void restartWebApp(boolean reconfigureScanner)
throws java.lang.Exception
java.lang.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.MojoFailureExceptionMojo.execute()public void configurePluginClasspath()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic boolean isPluginArtifact(org.apache.maven.artifact.Artifact artifact)
artifact - public void finishConfigurationBeforeStart()
throws java.lang.Exception
java.lang.Exceptionpublic void applyJettyXml()
throws java.lang.Exception
java.lang.Exceptionpublic void startJetty()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void configureWebApplication()
throws java.lang.Exception
org.apache.maven.plugin.MojoExecutionExceptionjava.lang.Exceptionprotected void startConsoleScanner()
throws java.lang.Exception
java.lang.Exceptionpublic java.io.File findJettyWebXmlFile(java.io.File webInfDir)
webInfDir - public void setSystemPropertiesFile(java.io.File file)
throws java.lang.Exception
file - java.lang.Exceptionpublic void setSystemProperties(SystemProperties systemProperties)
systemProperties - public java.util.List<java.io.File> getJettyXmlFiles()
public boolean isExcluded(java.lang.String goal)
goal - Copyright © 2015. All Rights Reserved.