org.mortbay.jetty.plugin
Class JettyRunForkedMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.mortbay.jetty.plugin.JettyRunForkedMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class JettyRunForkedMojo
extends org.apache.maven.plugin.AbstractMojo

This goal is used to assemble your webapp into a war and automatically deploy it to Jetty in a forked JVM.

You need to define a jetty.xml file to configure connectors etc and a context xml file that sets up anything special about your webapp. This plugin will fill in the:

Based on a combination of information that you supply and the location of files in your unassembled webapp.

There is a reference guide to the configuration parameters for this plugin, and more detailed information with examples in the Configuration Guide.


Nested Class Summary
 class JettyRunForkedMojo.ShutdownThread
           
 
Field Summary
 String PORT_SYSPROPERTY
           
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  File target
          The target directory
protected  File tmpDirectory
          The temporary directory to use for the webapp.
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.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
JettyRunForkedMojo()
           
 
Method Summary
 void execute()
           
static String fileSeparators(String path)
           
 String getClassPath()
           
 List<String> getProvidedJars()
           
 boolean isPluginArtifact(org.apache.maven.artifact.Artifact artifact)
           
static String pathSeparators(String path)
           
 File prepareConfiguration()
           
 void startJettyRunner()
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORT_SYSPROPERTY

public String PORT_SYSPROPERTY

useProvidedScope

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.


target

protected File target
The target directory


tmpDirectory

protected File tmpDirectory
The temporary directory to use for the webapp. Defaults to target/tmp


stopPort

protected int stopPort
Port to listen to stop jetty on executing -DSTOP.PORT=<stopPort> -DSTOP.KEY=<stopKey> -jar start.jar --stop


stopKey

protected String stopKey
Key to provide when stopping jetty on executing java -DSTOP.KEY=<stopKey> -DSTOP.PORT=<stopPort> -jar start.jar --stop

Constructor Detail

JettyRunForkedMojo

public JettyRunForkedMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
See Also:
Mojo.execute()

getProvidedJars

public List<String> getProvidedJars()
                             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

prepareConfiguration

public File prepareConfiguration()
                          throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

isPluginArtifact

public boolean isPluginArtifact(org.apache.maven.artifact.Artifact artifact)

startJettyRunner

public void startJettyRunner()
                      throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getClassPath

public String getClassPath()
                    throws Exception
Throws:
Exception

fileSeparators

public static String fileSeparators(String path)

pathSeparators

public static String pathSeparators(String path)


Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.