Class JettyRunForkedMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.eclipse.jetty.maven.plugin.AbstractJettyMojo
-
- org.eclipse.jetty.maven.plugin.JettyRunMojo
-
- org.eclipse.jetty.maven.plugin.JettyRunForkedMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="run-forked", requiresDependencyResolution=TEST) @Execute(phase=TEST_COMPILE) public class JettyRunForkedMojo extends JettyRunMojo
This goal is used to deploy your unassembled webapp into a forked JVM.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 https://jetty.org/docs/ for more information on this and other jetty plugins. Runs Jetty in forked JVM on an unassembled webapp
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
JettyRunForkedMojo.ShutdownThread
ShutdownThread
-
Field Summary
Fields Modifier and Type Field Description protected java.io.File
forkWebXml
The file into which to generate the quickstart web xml for the forked process to useprotected java.io.File
target
The target directory-
Fields inherited from class org.eclipse.jetty.maven.plugin.JettyRunMojo
classesDirectory, DEFAULT_WEBAPP_SRC, FAKE_WEBAPP, originalBaseResource, scanClassesPattern, scanTargetPatterns, scanTargets, scanTestClassesPattern, testClassesDirectory, useTestScope, warArtifacts, warPluginInfo, webAppSourceDirectory, webXml
-
Fields inherited from class org.eclipse.jetty.maven.plugin.AbstractJettyMojo
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 Summary
Constructors Constructor Description JettyRunForkedMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
java.lang.String
getContainerClassPath()
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()
-
Methods inherited from class org.eclipse.jetty.maven.plugin.JettyRunMojo
checkPomConfiguration, configureScanner, configureWebApplication, fileSeparators, finishConfigurationBeforeStart, gatherScannables, getArtifactForOverlay, getJavaBin, restartWebApp, unpackOverlay, unpackOverlays
-
Methods inherited from class org.eclipse.jetty.maven.plugin.AbstractJettyMojo
applyJettyXml, checkPackagingConfiguration, configureMonitor, configurePluginClasspath, findJettyWebXmlFile, getJettyXmlFiles, getSkipMessage, isConfigurationSupported, isExcluded, isScanningEnabled, printSystemProperties, setSystemProperties, setSystemPropertiesFile, startConsoleScanner, startScanner, stopScanner
-
-
-
-
Field Detail
-
target
@Parameter(defaultValue="${project.build.directory}", readonly=true, required=true) protected java.io.File target
The target directory
-
forkWebXml
@Parameter(defaultValue="${project.build.directory}/fork-web.xml") protected java.io.File forkWebXml
The file into which to generate the quickstart web xml for the forked process to use
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
- Specified by:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Overrides:
execute
in classJettyRunMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
- See Also:
Mojo.execute()
-
startJetty
public void startJetty() throws org.apache.maven.plugin.MojoExecutionException
- Overrides:
startJetty
in classAbstractJettyMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getProvidedJars
public java.util.List<java.lang.String> getProvidedJars() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
prepareConfiguration
public java.io.File prepareConfiguration() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
isPluginArtifact
public boolean isPluginArtifact(org.apache.maven.artifact.Artifact artifact)
- Overrides:
isPluginArtifact
in classAbstractJettyMojo
-
getContainerClassPath
public java.lang.String getContainerClassPath() throws java.lang.Exception
- Throws:
java.lang.Exception
-
pathSeparators
public static java.lang.String pathSeparators(java.lang.String path)
-
-