@Mojo(name="run-forked", requiresDependencyResolution=TEST) @Execute(phase=TEST_COMPILE) public class JettyRunForkedMojo extends JettyRunMojo
You need to define a jetty.xml file to configure connectors etc. You can use the normal setters of o.e.j.webapp.WebAppContext on the webApp configuration element for this plugin. You may also need context xml file for any particularly complex webapp setup.
Unlike the other jetty goals, this does NOT support the scanIntervalSeconds parameter: the webapp will be deployed only once.
The stopKey, stopPort configuration elements can be used to control the stopping of the forked process. By default, this plugin will launch the forked jetty instance and wait for it to complete (in which case it acts much like the jetty:run goal, and you will need to Cntrl-C to stop). By setting the configuration element waitForChild to false, the plugin will terminate after having forked the jetty process. In this case you can use the jetty:stop goal to terminate the process.
See http://www.eclipse.org/jetty/documentation for more information on this and other jetty plugins. Runs Jetty in forked JVM on an unassembled webapp
Modifier and Type | Class and Description |
---|---|
class |
JettyRunForkedMojo.ShutdownThread
ShutdownThread
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.String> |
env
Extra environment variables to be passed to the forked process
|
private java.lang.Process |
forkedProcess
The forked jetty instance
|
protected java.io.File |
forkWebXml
The file into which to generate the quickstart web xml for the forked process to use
|
private boolean |
hasSlf4jDeps
Whether or not the plugin has explicit slf4j dependencies.
|
private java.lang.String |
javaPath |
private java.lang.String[] |
jettyProperties
Optional list of jetty properties to put on the command line
|
private java.lang.String |
jvmArgs
Arbitrary jvm args to pass to the forked process
|
private long |
maxChildCheckInterval
Millisecs to wait between each
check to see if the child started successfully.
|
private int |
maxChildChecks
Max number of times to try checking if the
child has started successfully.
|
private org.apache.maven.plugin.descriptor.PluginDescriptor |
plugin |
private java.util.List<org.apache.maven.artifact.Artifact> |
pluginArtifacts |
private java.util.Random |
random
Random number generator
|
protected java.io.File |
target
The target directory
|
private boolean |
waitForChild |
classesDirectory, DEFAULT_WEBAPP_SRC, FAKE_WEBAPP, originalBaseResource, scanClassesPattern, scanTargetPatterns, scanTargets, scanTestClassesPattern, testClassesDirectory, useTestScope, warArtifacts, warPluginInfo, webAppSourceDirectory, webXml
consoleScanner, contextHandlers, contextXml, dumpOnStart, excludedGoals, execution, httpConnector, jettyXml, loginServices, nonBlocking, project, projectArtifacts, reload, requestLog, scanIntervalSeconds, scanner, server, serverSupport, skip, stopKey, stopPort, supportedPackagings, systemProperties, systemPropertiesFile, useProvidedScope, webApp
Constructor and Description |
---|
JettyRunForkedMojo() |
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
createToken() |
void |
execute() |
java.lang.String |
getContainerClassPath() |
private java.util.Set<org.apache.maven.artifact.Artifact> |
getExtraJars() |
java.util.List<java.lang.String> |
getProvidedJars() |
boolean |
isPluginArtifact(org.apache.maven.artifact.Artifact artifact) |
static java.lang.String |
pathSeparators(java.lang.String path) |
java.io.File |
prepareConfiguration() |
void |
startJetty() |
checkPomConfiguration, configureScanner, configureWebApplication, fileSeparators, finishConfigurationBeforeStart, gatherScannables, getArtifactForOverlay, getJavaBin, restartWebApp, unpackOverlay, unpackOverlays
applyJettyXml, checkPackagingConfiguration, configureMonitor, configurePluginClasspath, findJettyWebXmlFile, getJettyXmlFiles, getSkipMessage, isConfigurationSupported, isExcluded, isScanningEnabled, printSystemProperties, setSystemProperties, setSystemPropertiesFile, startConsoleScanner, startScanner, stopScanner
@Parameter(defaultValue="${project.build.directory}", readonly=true, required=true) protected java.io.File target
@Parameter(defaultValue="${project.build.directory}/fork-web.xml") protected java.io.File forkWebXml
@Parameter(property="jetty.jvmArgs") private java.lang.String jvmArgs
@Parameter private java.lang.String[] jettyProperties
@Parameter(defaultValue="${plugin.artifacts}", readonly=true) private java.util.List<org.apache.maven.artifact.Artifact> pluginArtifacts
@Parameter(defaultValue="${plugin}", readonly=true) private org.apache.maven.plugin.descriptor.PluginDescriptor plugin
@Parameter(defaultValue="true") private boolean waitForChild
@Parameter(alias="maxStartupLines", defaultValue="50") private int maxChildChecks
@Parameter(defaultValue="100") private long maxChildCheckInterval
@Parameter private java.util.Map<java.lang.String,java.lang.String> env
private java.lang.Process forkedProcess
private java.util.Random random
private boolean hasSlf4jDeps
@Parameter(property="jetty.javaPath") private java.lang.String javaPath
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
execute
in interface org.apache.maven.plugin.Mojo
execute
in class JettyRunMojo
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
Mojo.execute()
public void startJetty() throws org.apache.maven.plugin.MojoExecutionException
startJetty
in class AbstractJettyMojo
org.apache.maven.plugin.MojoExecutionException
public java.util.List<java.lang.String> getProvidedJars() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public java.io.File prepareConfiguration() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public boolean isPluginArtifact(org.apache.maven.artifact.Artifact artifact)
isPluginArtifact
in class AbstractJettyMojo
private java.util.Set<org.apache.maven.artifact.Artifact> getExtraJars() throws java.lang.Exception
java.lang.Exception
public java.lang.String getContainerClassPath() throws java.lang.Exception
java.lang.Exception
public static java.lang.String pathSeparators(java.lang.String path)
private java.lang.String createToken()