美文网首页
maven tomcat jetty plugins

maven tomcat jetty plugins

作者: ColorsLee | 来源:发表于2020-05-23 14:45 被阅读0次

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

  • tomcat插件
    <!--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>
  • jetty插件
     <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

相关文章

网友评论

      本文标题:maven tomcat jetty plugins

      本文链接:https://www.haomeiwen.com/subject/esakahtx.html