public abstract class AbstractJettyMojo
extends org.apache.maven.plugin.AbstractMojo
RunMojo.| Modifier and Type | Field and Description |
|---|---|
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 |
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 org.eclipse.jetty.maven.plugin.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 org.eclipse.jetty.security.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 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 org.eclipse.jetty.maven.plugin.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 org.eclipse.jetty.maven.plugin.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 org.eclipse.jetty.maven.plugin.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(org.eclipse.jetty.maven.plugin.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
@Parameter(defaultValue="false") protected boolean useProvidedScope
@Parameter protected String[] excludedGoals
@Parameter protected org.eclipse.jetty.server.handler.ContextHandler[] contextHandlers
@Parameter protected org.eclipse.jetty.security.LoginService[] loginServices
@Parameter protected org.eclipse.jetty.server.RequestLog requestLog
@Parameter protected org.eclipse.jetty.maven.plugin.JettyWebAppContext webApp
@Parameter(defaultValue="${jetty.scanIntervalSeconds}")
protected int scanIntervalSeconds
@Parameter(defaultValue="${jetty.reload}")
protected String reload
@Parameter(defaultValue="${jetty.systemPropertiesFile}")
protected File systemPropertiesFile
@Parameter protected org.eclipse.jetty.maven.plugin.SystemProperties systemProperties
@Parameter(alias="jettyConfig") protected String jettyXml
@Parameter protected int stopPort
@Parameter protected String stopKey
@Parameter(defaultValue="${dumponStart}")
protected boolean dumpOnStart
@Parameter(defaultValue="${jetty.skip}")
protected boolean skip
@Parameter(alias="webAppXml") protected String contextXml
@Component protected org.apache.maven.project.MavenProject project
@Parameter(defaultValue="${project.artifacts}")
protected Set projectArtifacts
@Parameter(defaultValue="${mojoExecution}",
readonly=true)
protected org.apache.maven.plugin.MojoExecution execution
@Parameter(defaultValue="${plugin.artifacts}",
readonly=true)
protected List pluginArtifacts
@Parameter protected org.eclipse.jetty.maven.plugin.MavenServerConnector httpConnector
protected org.eclipse.jetty.maven.plugin.JettyServer server
protected org.eclipse.jetty.util.Scanner scanner
protected ArrayList<org.eclipse.jetty.util.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
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 Exception
Exceptionpublic void startJetty()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void configureMonitor()
public void configureWebApplication()
throws Exception
org.apache.maven.plugin.MojoExecutionExceptionExceptionprotected void startConsoleScanner()
throws Exception
Exceptionprotected void printSystemProperties()
public File findJettyWebXmlFile(File webInfDir)
webInfDir - public void setSystemPropertiesFile(File file) throws Exception
file - Exceptionpublic void setSystemProperties(org.eclipse.jetty.maven.plugin.SystemProperties systemProperties)
systemProperties - public boolean isExcluded(String goal)
goal - Copyright © 2004-2016. All Rights Reserved.