008-插件方式启动web服务tomcat,jetty

一、pom引入

1、tomcat7

<!-- tomcat7 -->  
<plugin>  
    <groupId>org.apache.tomcat.maven</groupId>  
    <artifactId>tomcat7-maven-plugin</artifactId>  
    <version>2.2</version>  
    <configuration>  
        <useBodyEncodingForURI>true</useBodyEncodingForURI>  
        <path>/</path>  
    </configuration>  
</plugin>  

使用

tomcat7:run -Dmaven.tomcat.port=8080  

2、jetty

<!-- jetty -->  
<plugin>  
    <groupId>org.mortbay.jetty</groupId>  
    <artifactId>jetty-maven-plugin</artifactId>  
    <version>7.6.15.v20140411</version>  
    <configuration>  
        <useTestClasspath>true</useTestClasspath>  
        <webAppConfig>  
            <contextPath>/</contextPath>  
        </webAppConfig>  
    </configuration>  
</plugin>  

使用

jetty:run -Djetty.port=8081  

 

posted @ 2018-10-03 16:25  bjlhx15  阅读(282)  评论(0编辑  收藏  举报
Copyright ©2011~2020 JD-李宏旭