maven工程使用jetty插件

<build>
  <finalName>test</finalName>
  <plugins>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
     <source>7</source>
     <target>7</target>
     <encoding>UTF-8</encoding>
    </configuration>
   </plugin>
 
   <plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>7.2.2.v20101205</version>
    <configuration>
     <reload>manual</reload>
     <webAppConfig>
      <contextPath>/</contextPath>
      <!-- <defaultsDescriptor>servers/jetty/webdefault.xml</defaultsDescriptor> -->
     </webAppConfig>
     <connectors>
      <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
       <port>8080</port>
       <host>localhost</host>
       <maxIdleTime>60000</maxIdleTime>
      </connector>
     </connectors>
     <stopKey>foo</stopKey>
     <stopPort>9999</stopPort>
     <systemProperties>
      <systemProperty>
       <name>org.eclipse.jetty.util.URI.charset</name>
       <value>UTF-8</value>
      </systemProperty>
     </systemProperties>
    </configuration>
    <executions>
     <execution>
      <id>start-jetty</id>
      <phase>pre-integration-test</phase>
      <goals>
       <goal>run</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>
  </plugins>
 </build>
 
启动:mvn jetty:run
        mvnDebug jetty:run
posted @ 2015-04-19 15:54  圣雄1990  阅读(128)  评论(0)    收藏  举报