public abstract class AbstractJettyMojo
extends org.apache.maven.plugin.AbstractMojo
Modifier and Type | Field and Description |
---|---|
protected Thread |
consoleScanner
A scanner to check ENTER hits on the console
|
protected ContextHandler[] |
contextHandlers
List of other contexts to set up.
|
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 |
dumpOnStart
Use the dump() facility of jetty to print out the server configuration to logging
|
protected 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 String |
jettyXml
Comma separated list of a jetty xml configuration files whose contents
will be applied before any plugin configuration.
|
protected LoginService[] |
loginServices
List of security realms to set up.
|
protected boolean |
nonblocking
Determines whether or not the server blocks when started.
|
protected List |
pluginArtifacts
The artifacts for the plugin itself.
|
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 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 Scanner |
scanner
A scanner to check for changes to the webapp
|
protected ArrayList<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 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 |
configureMonitor() |
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() |
List<File> |
getJettyXmlFiles() |
boolean |
isExcluded(String goal) |
boolean |
isPluginArtifact(org.apache.maven.artifact.Artifact artifact) |
protected void |
printSystemProperties() |
abstract void |
restartWebApp(boolean reconfigureScanner) |
void |
setSystemProperties(SystemProperties systemProperties) |
void |
setSystemPropertiesFile(File file) |
protected void |
startConsoleScanner()
Run a thread that monitors the console input to detect ENTER hits.
|
void |
startJetty() |
public String PORT_SYSPROPERTY
protected boolean useProvidedScope
protected String[] excludedGoals
protected ContextHandler[] contextHandlers
protected LoginService[] loginServices
protected RequestLog requestLog
protected JettyWebAppContext webApp
protected int scanIntervalSeconds
protected String reload
protected File systemPropertiesFile
protected SystemProperties systemProperties
protected String jettyXml
protected int stopPort
protected String stopKey
protected boolean dumpOnStart
protected boolean skip
protected String contextXml
protected org.apache.maven.project.MavenProject project
protected Set projectArtifacts
protected org.apache.maven.plugin.MojoExecution execution
protected List pluginArtifacts
protected MavenServerConnector httpConnector
protected JettyServer server
protected Scanner scanner
protected ArrayList<Scanner.BulkListener> scannerListeners
protected Thread consoleScanner
protected boolean nonblocking
Determines whether or not the server blocks when started. The default behavior (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. This is the behaviour of the jetty:run, jetty:run-war, jetty:run-war-exploded goals.
If true, the server will not block the execution of subsequent code. This is the behaviour of the jetty:start and default behaviour of the jetty:deploy goals.
public abstract void restartWebApp(boolean reconfigureScanner) throws Exception
Exception
public abstract void checkPomConfiguration() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public abstract void configureScanner() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
Mojo.execute()
public void configurePluginClasspath() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public boolean isPluginArtifact(org.apache.maven.artifact.Artifact artifact)
artifact
- public void finishConfigurationBeforeStart() throws Exception
Exception
public void startJetty() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public void configureMonitor()
public void configureWebApplication() throws Exception
org.apache.maven.plugin.MojoExecutionException
Exception
protected void startConsoleScanner() throws Exception
Exception
protected void printSystemProperties()
public File findJettyWebXmlFile(File webInfDir)
webInfDir
- public void setSystemPropertiesFile(File file) throws Exception
file
- Exception
public void setSystemProperties(SystemProperties systemProperties)
systemProperties
- public boolean isExcluded(String goal)
goal
- Copyright © 1995-2015 Webtide. All Rights Reserved.