本例是用的是tomcat7-maven-plugin 插件

依赖

  tomcat7-maven-plugin 插件的pom.xml依赖为

 <dependency>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
</dependency>

使用

  1、新建一个maven web项目

  2、在pom文件中添加插件

   <build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>tomcat-run</id>
<goals>
<goal>exec-war-only</goal>
</goals>
<phase>package</phase>
<configuration>
<!-- ServletContext path -->
<path>/webapp</path>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

  3、打包maven web项目,可以在target目录中,找到jar包
           

  4、使用java命令运行jar包,命令:java -jar xxx-war-exec.jar
    

  5、浏览器访问地址:http://localhost:8080/webapp/
    

【Java】Maven Tomcat插件使用的更多相关文章

  1. 排除maven jar冲突 maven tomcat插件启动报错 filter转换异常

    最近在搞一个ssm+shiro的整合 用的maven tomcat插件 启动的时候报错,提示 maven org.springframework.web.filter.CharacterEncodin ...

  2. (转)淘淘商城系列——使用maven tomcat插件启动聚合工程

    http://blog.csdn.net/yerenyuan_pku/article/details/72672389 上文我们一起学习了如何使用maven tomcat插件来启动web工程,本文我们 ...

  3. (转)淘淘商城系列——使用maven tomcat插件启动web工程

    http://blog.csdn.net/yerenyuan_pku/article/details/72672138 上文我们一起学习了怎样搭建maven工程,这篇文章我就来教大家一起学习怎样用to ...

  4. myeclipse maven tomcat插件 创建web工程

    自从有了云笔记,很久不写博客了.今天写了使用Freemarker静态化JSP页面,索性就发出来.初学,勿喷. 这篇文字以前放在云笔记里,当然里面有很多借鉴网络上的东西,而自己也使用Maven很久了,索 ...

  5. maven tomcat 插件

    在 pom.xml 中添加如下内容 <!-- 配置 tomcat 插件 --> <build> <plugins> <plugin> <group ...

  6. maven tomcat 插件实现热部署

    tomcat 的maven插件有助于提高开发效率,原因是: --可以直接把项目发布到远程的服务器上. --能够实现项目的热部署,在开发过程中修改了Java类,不需要重启tomcat 首先配置一个tom ...

  7. maven tomcat插件上传项目到tomcat服务器报错SEVERE: One or more listeners failed to start.

    以前觉了maven依赖设置很简单,就是将手动导入jar包转化为自动下载导入 但发现的一个问题, 在使用maven插件tomcat打包上传工具时 tomcat-maven-plugin <buil ...

  8. IDEA使用Maven+Tomcat插件实现热部署

    1 配置tomcat pom.xml <!-- tomcat7启动插件 --> <plugin> <groupId>org.apache.tomcat.maven& ...

  9. eclipse使用maven tomcat插件部署无法关联源代码

    一. 安装sourcelookup插件: 二. 在source lookup path里加入源码: 2.1) 加入项目源码或整个工作空间的源码(不加上连自己的代码都无法查看,默认是不加上的) 2.2) ...

随机推荐

  1. 五 shutil模块

    高级的 文件.文件夹.压缩包 处理模块 shutil.copyfileobj(fsrc, fdst[, length])将文件内容拷贝到另一个文件中 1 import shutil 2 3 shuti ...

  2. hbase备份数据与异地新建

    hbase org.apache.hadoop.hbase.mapreduce.Driver export news /tmp/news1 备份news表至hdfs的/tmp目录下面. hadoop ...

  3. vue项目中,localhost可以访问,IP无法访问的问题

    用http://localhost:8082/可以访问,但是换到ip就访问不了,127.0.0.1.0.0.0.0访问也可以,就ip不行 根源----在config里面的index.js里面的modu ...

  4. 全国高校绿色计算大赛 预赛第一阶段(C++)第4关:计算日期

    挑战任务 我们吃的食物都有保质期,现在食品监督管理局想要制作一个能准确计算食品过期日期的小程序,需要请你来进行设计. 例如:A食品在2018年1月1日生产,保质期是20天,则它的过期日期在2018年1 ...

  5. 虚拟机VM下CentOS7部署WASND9+HTTP9

    本地操作系统:WIN10(64位) 虚拟机:14.1.1 build-7528167 安装环境:CentOS7 64 软件版本:IM 1.8  WAS 9.0+HTTP9.0 一.安装CentOS7 ...

  6. Python hash() 函数

    Python hash() 函数  Python 内置函数 描述 hash() 用于获取取一个对象(字符串或者数值等)的哈希值. 语法 hash 语法: hash(object) 参数说明: obje ...

  7. 如何利用FPGA进行时序分析设计

    FPGA(Field-Programmable Gate Array),即现场可编程门阵列,它是作为专用集成电路(ASIC)领域中的一种半定制电路而出现的,既解决了定制电路的不足,又克服了原有可编程器 ...

  8. UVa 122 Trees on the level(二叉树层序遍历)

    Trees are fundamental in many branches of computer science. Current state-of-the art parallel comput ...

  9. 动态替换iframe的src及动态改变iframe的高度

    实现效果:点击左侧右侧内容变化,但左侧保持不变(如折叠等) 动态替换iframe的src <iframe width="100%" frameBorder="0&q ...

  10. linux命令学习之:top

    top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器. top显示系统当前的进程和其他状况,是一个动态显示过程,即可以通过用户按键来不 ...