Maven - Deploy war in Tomcat 7 & 8
This article will explain on how to deploy a war fine in to Tomcat 7 through maven build.
Note : I have tested same settings for Tomcat 8 as well. So below settings can be apply for both versions.
Configure tomcat7-maven-plugin in pom.xml
<!-- Tomcat plugin -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<!-- finalName:defaults to ${artifactId}-${version} -->
<path>/beepay</path>
<update>true</update>
<url>http://localhost:8080/manager/text</url>
<server>Tomcat</server>
<username>tomcat</username>
<password>tomcatuser</password>
</configuration>
</plugin>
Configure user rights in the tomcat-user.xml which is in the tomcat conf file.
<role rolename="tomcat" />
<role rolename="manager-gui" />
<role rolename="manager-script" />
<role rolename="admin-gui" />
<user username="tomcat" password="tomcatuser"
roles="tomcat,manager-gui,admin-gui,manager-script" />
Adding server to Maven settings.xml file: Next step is to add a server in maven settings.xml file, as shown below.
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>Tomcat</id>
<username>tomcat</username>
<password>tomcatuser</password>
</server>
</servers>
</settings>
overwrite the tomcat-users.xml to eclipse server folder :Project Explorer > 'Server's > Tomcat v7.0 Server at localhost-config > tomcat-users.xml
change default deployment path to:
add a mvn goal:
Maven - Deploy war in Tomcat 7 & 8的更多相关文章
- Jenkins deploy war to tomcat over https
ssl - HTTPS login with Spring Security redirects to HTTP - Stack Overflow https://stackoverflow.com/ ...
- maven 打war包tomcat服务器乱码问题
今天用maven3的命令打war包,命令是mvn clean package -Dmaven.test.skip=true,打包后放在tomcat跑起来后发现tomcat的日志出现乱码. 后来在pom ...
- 用Maven部署war包到远程Tomcat服务器
过去我们发布一个Java Web程序通常的做法就是把它打成一个war包,然后用SSH这样的工具把它上传到服务器,并放到相应的目录里,让Tomcat自动去解包,完成部署. 很显然,这样做不够方便,且我们 ...
- Hudson + SVN + Maven 持续集成实现自动化编译、打包、部署(over SSH 和 Deploy war/ear to a container 两种部署方式)
下载hudson ,安装部署http://hudson-ci.org/ 将下载的hudson-3.3.3.war放到tomcat的webapps目录下并启动tomcat,输入地址访问 点击Instal ...
- war 包tomcat部署和maven的tomcat插件部署的不同
不用插件 1在linux服务器上下载号tomcat 或者上传tomcat 2上传war包,最好创建一个目录房war包,和tomcat 3解压war包,jar -xvf war 或者unzip wa ...
- 部署基于Maven的war文件到Tomcat
在本教程中,我们将学习如何使用Maven的Tomcat插件打包并部署一个WAR文件到Tomcat(Tomcat的6和7. 要用到工具: Maven 3 Tomcat 6.0.37 Tomcat 7.0 ...
- 170329、用 Maven 部署 war 包到远程 Tomcat 服务器
过去我们发布一个Java Web程序通常的做法就是把它打成一个war包,然后用SSH这样的工具把它上传到服务器,并放到相应的目录里,让Tomcat自动去解包,完成部署. 很显然,这样做不够方便,且我们 ...
- maven 学习---部署基于Maven的war文件到Tomcat
在本教程中,我们将学习如何使用Maven的Tomcat插件打包并部署一个WAR文件到Tomcat(Tomcat的6和7. 要用到工具: Maven 3 Tomcat 6.0.37 Tomcat 7.0 ...
- Jenkins中deploy插件的deploy war/ear to a container与deploy artifacts to maven reepository区别
deploy war/ear to a container:发布war包到服务器 deploy artifacts to maven reepository:发布到maven服务器
随机推荐
- 带你走进脚本世界,ijkplayer之【init-ios.sh】脚本分析
前言 集成ijkplayer,需要执行脚本init-ios.sh,那么init-ios.sh脚本干嘛用的了,花了半天时间,学习了下shell脚本,感觉脚本语言学起来还是比较容易上手的,现在仅仅能看懂了 ...
- do-while语句和while的区别
do-while语句是一种后测试循环语句,即只有在循环体中的代码执行之后,才会测试出口条件.其实就是,代码在刚开始执行的时候,都是要先走一遍do循环体内的代码,然后在与while里面的条件进行判断,成 ...
- hdu 6158 The Designer( 反演圆)
The Designer Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tota ...
- maven中jar、war、pom的区别
一.maven的三种packaging方式 pom是maven依赖文件 jar是java普通项目打包 war是java web项目打包 pom:打出来可以作为其他项目的maven依赖,在工程A中添加工 ...
- MIPS 汇编指令学习
MIPS 寄存器 MIPS comes with 32 general purpose registers named $0. . . $31Registers also have symbolic ...
- protel 99se 全部焊盘和过孔补泪滴,很多都是失败的,对板子有影响吗?补泪滴的作用?
泪滴 是焊盘与导线或者是导线与导孔之间的滴装连接过度,设置泪滴的目的是在电路板受到巨大外力的冲撞时,避免导线与焊盘或者导线与导孔的接触点断开,另外,设置泪滴也可使PCB电路板显得更加美观.te ...
- VScode+Flutter 开发继续踩坑
运行慢解决方法1:修改build.gradle,注释掉jcenter(),google().使用阿里的镜像.原因是jcenter google库无法访问到导致的问题.虽然我有万能的爬墙工具,开启全局代 ...
- I.MX6 Manufacturing Tool V2 (MFGTool2) ucl2.xml hacking
<!-- * Copyright (C) 2010-2013, Freescale Semiconductor, Inc. All Rights Reserved. * The CFG elem ...
- ZetCode PyQt4 tutorial basic painting
#!/usr/bin/python # -*- coding: utf-8 -*- """ ZetCode PyQt4 tutorial In this example, ...
- HDU 4764:Stone(巴什博弈)
Stone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submi ...