maven tomcat jetty plugins

2020-05-23  本文已影响0人  ColorsLee

在pom.xml文件中加入如下插件代码,即可直接使用tomcat和jetty,不用安装实体。

    <!--tomcat的maven插件-->
      <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <path>/</path>
          <port>8080</port>
          <uriEncoding>UTF-8</uriEncoding>
        </configuration>
      </plugin>
     <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>9.4.29.v20200521</version>
        <configuration>
          <httpConnector>
            <port>8080</port>
            <host>localhost</host>
          </httpConnector>
        </configuration>
      </plugin>

运行命令:tomcat7:run和jetty:run

上一篇下一篇

猜你喜欢

热点阅读