はい、できます :) 1 つの WAR モジュールをプライマリとして識別し、他のすべての WAR をプライマリのターゲット ディレクトリにコピーし、jetty.xml を作成し、Maven Jetty プラグインに jetty.xml を使用するように指示します。Maven 依存関係プラグインを使用して他の WAR をコピーする方法は次のとおりです。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.foo</groupId>
<artifactId>bar</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>target/</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
com.foo:bar 依存関係も POM で定義する必要があります。jetty.xml の内容は次のとおりです。
<?xml version="1.0"?>
<!-- =========================================================== -->
<!-- Set handler Collection Structure -->
<!-- =========================================================== -->
<Set name="handler">
<New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
<Set name="handlers">
<Array type="org.eclipse.jetty.server.Handler">
<Item>
<New class="org.eclipse.jetty.server.handler.ContextHandlerCollection"
id="Contexts">
<Set name="handlers">
<Array type="org.eclipse.jetty.server.Handler">
<Item>
<New id="FooWebHandler"
class="org.eclipse.jetty.webapp.WebAppContext"/>
</Item>
</Array>
</Set>
</New>
</Item>
</Array>
</Set>
</New>
</Set>
<Ref id="FooWebHandler">
<Set name="contextPath">/foo</Set>
<Set name="war">
target/bar-${project.version}.war
</Set>
</Ref>
Maven Jetty プラグインに新しい jetty.xml を使用するように指示する方法は次のとおりです。
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<jettyConfig>${basedir}/jetty.xml</jettyConfig>
</configuration>
ここで、Eclipse から jetty:run-war ゴールを開始すると、すべての WAR が 1 つの Maven Jetty プラグイン インスタンスにデプロイされていることがわかります。これをコマンドラインから実行すると、YMMV with Eclipse で動作します。