当前位置:编程学习 > html/css >>

maven jetty plugin

 


TIPS ==============


mvn jetty:run, 自动运行,使用的class在 /target/classes, 使用的webapp在 src/main/webapp, 使用的web.xml在 src/main/webapp/WEB-INF/web.xml
启动后,自动监听加载文件变化情况,可在eclipse中边改,边测试
通过如下配置,可在集成测试时自动启动和停止
[html]  <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> 

 <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>


[html]  端口、root等配置: 
 
                <configuration> 
 
          <contextpath>/</contextpath> 
 
          <connectors> 
 
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> 
 
              <port>8080</port> 
 
              <maxidletime>60000</maxidletime> 
 
            </connector> 
 
          </connectors> 
 
          <scanintervalseconds>10</scanintervalseconds>

补充:web前端 , HTML/CSS  ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,