jetty maven插件不会部署我的第二次战争

时间:2012-12-20 13:13:59

标签: maven jetty

我正在尝试在jetty上部署两场战争,第一场已部署,但第二架未部署。这是我对插件的配置:

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.maven.plugin.version}</version>
<configuration>
    <stopKey>stop</stopKey>
    <stopPort>9999</stopPort>
    <war>${project.build.directory}/integration-test/webapp-fast.war</war>
    <webApp>
        <contextPath>/webapp-fast</contextPath>
    </webApp>
    <contextHandlers>  
        <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
          <war>${project.build.directory}/integration-test/stubs.war</war>
          <contextPath>/stubs</contextPath>
        </contextHandler>
            </contextHandlers>  
</configuration>
<executions>
    <execution>
        <id>start-jetty</id>
        <phase>pre-integration-test</phase>
        <goals>
            <goal>deploy-war</goal>
        </goals>
        <configuration>
            <scanIntervalSeconds>0</scanIntervalSeconds>
            <daemon>true</daemon>
        </configuration>
    </execution>
    <execution>
        <id>stop-jetty</id>
        <phase>post-integration-test</phase>
        <goals>
            <goal>stop</goal>
        </goals>
    </execution>
</executions>
</plugin>

我做错了什么?

1 个答案:

答案 0 :(得分:0)

尝试使用contextHandlers部署两场战争:

<contextHandlers>  
    <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
      <war>${project.build.directory}/integration-test/stubs.war</war>
      <contextPath>/stubs</contextPath>
    </contextHandler>
    <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
      <war>${project.build.directory}/integration-test/webapp-fast.war</war>
      <contextPath>/webapp-fast</contextPath>
    </contextHandler>
</contextHandlers>