zoukankan      html  css  js  c++  java
  • Eclipse中,tomcat插件方式启动项目

    某些项目要运行多个war包,所以需要开启多个tomcat服务器,按照传统的方式则是新建多个tomcat服务器,比较麻烦。现在采用新的启动方式。

    1.在Maven项目中的pom.xml文件中添加tomcat插件依赖:

    <!-- 配置tomcat服务器插件 -->
    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat7-maven-plugin</artifactId>
          <configuration>
            <path>/</path>        //引入工程名
            <port>8081</port>       //配置端口名
          </configuration>
        </plugin>
      </plugins>
    </build>

    2.右击项目:选择Run as,再选择Maven build... ,在Goals中填写 : clean tomcat7:run          // tomcat7为插件版本

    然后 点击Run即可。

    3.报错解决:

    a) 错误之一是:项目依赖的某个jar包没有被找到;解决方式为:右击项目,选择Run as,再选择Maven install ,之后可解决问题

    b) 错误之二是:Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project **-web: Failed to clean project: Failed to delete     E:** arget omcatlogsaccess_log;原因是该项目同时开启了多个tomcat插件。

    解决方式:关闭所有的tomcat插件,然后重新开启tomcat插件。关闭tomcat插件操作如下:

    然后再开启tomcat插件即可。

  • 相关阅读:
    正则表达式
    request库解析
    urllib库解析
    爬虫入门基本原理
    图的遍历dfs和bfs
    KMP算法
    Linux操作系统实验-线程同步
    Leetcode 183场周赛
    并查集--Disjoint Set
    C#杂乱知识汇总
  • 原文地址:https://www.cnblogs.com/momoweiduan/p/8196709.html
Copyright © 2011-2022 走看看