<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.10.v20130312</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<!-- configure the container -->
<!--add a jetty.xml file to webapp A. and then add WebAppContexts for the other 2 webapps:
<jettyXml>src/main/etc/jetty.xml</jettyXml>
<Ref id="Contexts">
<Call name="addHandler">
<Arg>
<New class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/B</Set>
<Set name="war">../../B.war</Set>
</New>
</Arg>
</Call>
<Call>
<Arg>
<New class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/C</Set>
<Set name="war">../../C.war</Set>
</New>
</Arg>
</Call>
</Ref>
-->
<contextHandlers>
<contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
<war>${basedir}../../B.war</war>
<contextPath>/B</contextPath>
</contextHandler>
<contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
<war>${basedir}../../C.war</war>
<contextPath>/B</contextPath>
</contextHandler>
</contextHandlers>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>7777</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<useProvidedScope>true</useProvidedScope>
<systemPropertiesFile>${basedir}/mysys.props</systemPropertiesFile>
<systemProperties>
<systemProperty>
<name>fooprop</name>
<value>222</value>
</systemProperty>
<systemProperty>
<name>org.apache.commons.logging.Log</name>
<value>org.apache.commons.logging.impl.Log4JLogger</value>
</systemProperty>
<systemProperty>
<name>slf4j</name>
<value>false</value>
</systemProperty>
<systemProperty>
<name>log4j.configuration</name>
<value>file:/${jetty.home}/resources/log4j.properties</value>
</systemProperty>
</systemProperties>
<war>${basedir}/target/myfunkywebapp</war>
<!--
<contextXml> Optional The path to a context xml file that is applied to your webapp AFTER the <webApp> element.
-->
<webApp>
<contextPath>/test</contextPath>
<!--
<contextPath> The context path for your webapp. By default, this is set to the /${project.artifactId} from the project's pom.xml.
<descriptor> The path to the web.xml file for your webapp.
<defaultsDescriptor> The path to a webdefault.xml file that will be applied to your webapp before the web.xml. If none is supplied, Jetty uses a default one baked into the jetty-webapp.jar.
<overrideDescriptor> The path to a web.xml file that will be applied after your web.xml is read. You can use this to replace or add configuration.
<tempDirectory> The path to a dir that Jetty can use to expand or copy jars and jsp compiles when your webapp is running. The default is ${project.build.outputDirectory}/tmp
<baseResource> the path from which Jetty will serve static resources. Defaults to src/main/webapp.
<resourceBases> use instead of <baseResource> if you have multiple dirs from which you want to serve static content. This is an array of dir names.
<baseAppFirst> Optional. Defaults to "true". Controls whether any overlayed wars are added before or after the original base resource(s) of the webapp.
<jettyEnvXml> Optional. Location of a jetty-env.xml file, which allows you to make JNDI bindings that satisfies <env-entry>, <resource-env-ref> and <resource-ref> linkages in the web.xml. Note that these can also be made in a <jettyXml> file if you want them to apply to more than one webapp.
<containerIncludeJarPattern>. Since jetty-8.1.x. Optional. A pattern to match against the urls of the jars on the container path to select those that should be examined for things like META-INF fragments, resources, tlds and class inheritance hierarchy (used with servlet container initializers).
<webInfIncludeJarPattern>. Since jetty-8.1.6. Optional. A pattern to match against the urls of the jars considered to be on the webapp's WEB-INF classpath to select those that should be examined for META-INF fragments, resources, tlds, and class inheritance hierarchy (used with servlet container initializers). The default is to potentially examine them all, subject to any ordering exclusions configured in web.xml.
<classesDirectory> – Location of your compiled classes for the webapp. You should rarely need to set this parameter. Instead, you should set <build><outputDirectory> in your pom.xml.
<testClassesDirectory> – Location of the compiled test classes for your webapp. By default this is ${project.build.testOutputDirectory}.
<useTestScope> – If true, the classes from <testClassesDirectory> and dependencies of scope "test" are placed first on the classpath. By default this is false.
<useProvidedScope> - If true, the dependencies with scope "provided" are placed onto the container classpath. Note: NOT the webapp classpath, as "provided" indicates that these dependencies would normally be expected to be provided by the container. You should very rarely ever need to use this. Instead, you should copy the provided dependencies as explicit dependencies of the <plugin> instead.
<webAppSourceDirectory> – By default, this is set to ${basedir}/src/main/webapp. If your static sources are in a different location, set this parameter accordingly.
<scanTargets> –Optional A list of files and directories to periodically scan in addition to those automatically scanned by the plugin.
<scanTargetPatterns> –Optional If you have a long list of extra files you want scanned, it is more convenient to use pattern matching expressions to specify them instead of enumerating them with the <scanTargets>–List of <scanTargetPattern>s, each consisting of a <directory,> and <including> and/or <excluding> parameters to specify the file matching patterns.
<skip> - Optional Default is false. If true, the execution of the plugin will exit. Same as setting the SystemProperty -Djetty.skip on the command line.
-->
</webApp>
<loginServices>
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
<name>Test Realm</name>
<config>${basedir}/src/etc/realm.properties</config>
</loginService>
</loginServices>
<!--
<loginServices>
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
<name>java:/jaas/company-sso</name>
<config>${jetty.home}/etc/company/system/company-realm.properties</config>
</loginService>
</loginServices>
-->
</configuration>
</plugin>