私は最近、同じ問題に取り組む必要がありました。Jetty7をMaven 3内で実行し、リライトルールを設定して初期化します。コンポーネントはpom.xml、jetty.xmlの2つだけです。
これがpom.xmlのスニペットです:
<profile>
<id>jetty</id>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.2.2.v20101205</version>
<configuration>
<jettyConfig>${project.basedir}/config/jetty7/jetty.xml</jettyConfig>
<webAppConfig>
<contextPath>/${project.artifactId}</contextPath>
</webAppConfig>
<scanIntervalSeconds>10</scanIntervalSeconds>
</configuration>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
<version>7.2.2.v20101205</version>
<type>jar</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-rewrite</artifactId>
<version>7.2.2.v20101205</version>
<type>jar</type>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
Jetty構成ファイルを明示的に設定したことに気付くでしょう。このファイルは、使用しているJettyのバージョンと一致する必要があります。他の安定したリリースで問題が発生したため、上記のように7.2.2.v20101205を選択しました。そのjetty.xmlを取得したら、その下部に次のコードを追加する必要があります。
<Get id="oldhandler" name="handler"/>
<Set name="handler">
<New id="Rewrite" class="org.eclipse.jetty.rewrite.handler.RewriteHandler">
<Set name="handler">
<Ref id="oldhandler" />
</Set>
<Set name="rewriteRequestURI">true</Set>
<Set name="rewritePathInfo">false</Set>
<Set name="originalPathAttribute">requestedPath</Set>
<!-- Added for mainsite js tagging files -->
<Call name="addRule">
<Arg>
<New class="org.eclipse.jetty.rewrite.handler.RedirectPatternRule">
<Set name="pattern">/redirect/*</Set>
<Set name="location">/redirected</Set>
</New>
</Arg>
</Call>
</New>
</Set>
Jettyの書き換えの構文は、インターネットでも、Jetty7.xtarにパッケージ化されるetc/jetty-rewrite.xmlファイルで簡単に見つけることができます。