首页 > 代码库 > maven学习:jetty插件与Tomcat插件

maven学习:jetty插件与Tomcat插件

1、jetty插件

要测试的web的pom里面,加入jetty的插件配置,示例如下:

<!-- jetty插件 -->
<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>8.1.14.v20131031</version>
    <configuration>
        <scanIntervalSeconds>10</scanIntervalSeconds>
        <stopPort>9999</stopPort>
        <webAppConfig>
            <contextPath>/customer</contextPath>
	</webAppConfig>
        <connectors>
            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                <port>9080</port>
                <maxIdleTime>60000</maxIdleTime>
            </connector>
        </connectors>
    </configuration>
</plugin>

eclipse配置:右击项目-->Run As-->Run Configurations...

    技术分享


效果:

    技术分享

2、tomcat插件

<!-- 配置Tomcat插件 -->
<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <configuration>
        <port>8080</port>
        <path>/</path>
    </configuration>
</plugin>

eclipse配置:右击项目-->Run As-->Run Configurations...

    技术分享


本文出自 “我爱大金子” 博客,请务必保留此出处http://1754966750.blog.51cto.com/7455444/1912065

maven学习:jetty插件与Tomcat插件