maven eclipse远程部署tomcat
<finalName>shiro</finalName>//项目名称
</properties>
<!-- 插件 -->
<url>http://mvnrepository.com/</url>
<repositories>
<repository>
<id>people.apache.snapshots</id>
<url>http://mvnrepository.com/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories> <pluginRepositories>
<pluginRepository>
<id>apache.snapshots</id>
<name>Apache Snapshots</name>
<url>http://mvnrepository.com/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<build>
<finalName>${finalName}</finalName>//打包项目名称
31 <plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<url>http://192.168.1.3:8080/manager/text</url> //tomcat管理页面路径,tomcat7
<path>/${finalName}</path> //项目访问路径
<server>com.self.deploy</server>
<username>admin</username>
<password>admin</password>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin> </plugins>
<!-- mybatis的映射配置文件.xml -->
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
conf/tomcat-users.xml 用户权限配置,与webapp/manager/WEB-INF/web.xml中的role对应,下文异常2
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
</tomcat-users>
maven conf\settings.xml
<server><id>com.self.deploy</id><username>admin</username><password>admin</password></server>
注:id与pom.xml<server>,账户密码一致
tomcat7:deploy 部署
tomcat7:redeploy 重新部署
异常1:[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:redeploy (default-cli) on project shiro: Cannot invoke Tomcat manager: Connection to http://192.168.1.3:8080 refused: Connection refused: connect -> [Help 1]
原因:部署前未启动远程tomcat,部署前需要先启动远程tomcat
异常2:权限不足
[INFO] tomcatManager status code:, ReasonPhrase:Unauthorized
[INFO] <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
[INFO] <html>
[INFO] <head>
[INFO] <title> Unauthorized</title>
[INFO] <style type="text/css">
[INFO] <!--
[INFO] BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;}
[INFO] H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
[INFO] PRE, TT {border: 1px dotted #525D76}
[INFO] A {color : black;}A.name {color : black;}
[INFO] -->
[INFO] </style>
[INFO] </head>
[INFO] <body>
[INFO] <h1> Unauthorized</h1>
[INFO] <p>
[INFO] You are not authorized to view this page. If you have not changed
[INFO] any configuration files, please examine the file
[INFO] <tt>conf/tomcat-users.xml</tt> in your installation. That
[INFO] file must contain the credentials to let you use this webapp.
[INFO] </p>
[INFO] <p>
[INFO] For example, to add the <tt>manager-gui</tt> role to a user named
[INFO] <tt>tomcat</tt> with a password of <tt>s3cret</tt>, add the following to the
[INFO] config file listed above.
[INFO] </p>
[INFO] <pre>
[INFO] <role rolename="manager-gui"/>
[INFO] <user username="tomcat" password="s3cret" roles="manager-gui"/>
[INFO] </pre>
[INFO] <p>
[INFO] Note that for Tomcat onwards, the roles required to use the manager
[INFO] application were changed from the single <tt>manager</tt> role to the
[INFO] following four roles. You will need to assign the role(s) required for
[INFO] the functionality you wish to access.
[INFO] </p>
[INFO] <ul>
[INFO] <li><tt>manager-gui</tt> - allows access to the HTML GUI and the status
[INFO] pages</li>
[INFO] <li><tt>manager-script</tt> - allows access to the text interface and the
[INFO] status pages</li>
[INFO] <li><tt>manager-jmx</tt> - allows access to the JMX proxy and the status
[INFO] pages</li>
[INFO] <li><tt>manager-status</tt> - allows access to the status pages only</li>
[INFO] </ul>
[INFO] <p>
[INFO] The HTML interface is protected against CSRF but the text and JMX interfaces
[INFO] are not. To maintain the CSRF protection:
[INFO] </p>
[INFO] <ul>
[INFO] <li>Users with the <tt>manager-gui</tt> role should not be granted either
[INFO] the <tt>manager-script</tt> or <tt>manager-jmx</tt> roles.</li>
[INFO] <li>If the text or jmx interfaces are accessed through a browser (e.g. for
[INFO] testing since these interfaces are intended for tools not humans) then
[INFO] the browser must be closed afterwards to terminate the session.</li>
[INFO] </ul>
[INFO] <p>
[INFO] For more information - please see the
[INFO] <a href="/docs/manager-howto.html">Manager App HOW-TO</a>.
[INFO] </p>
[INFO] </body>
[INFO] </html>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
maven eclipse远程部署tomcat的更多相关文章
- Maven项目远程部署到Tomcat
目录 Maven项目远程部署到Tomcat 一.Tomcat插件支持的目标 二.系统要求及插件引入 2.1 系统要求 2.2 引入插件 三.远程部署war到tomcat 3.1 添加tomcat管理角 ...
- 关于在eclipse上部署Tomcat时出现8080等端口被占用问题的解决方法
问题描述: 在eclipse中部署Tomcat时,出现如下错误. 解决方法如下: 方法一: 1.开始->cmd->输入命令netstat -ano出现下图所示(注意下边显示有些错位,最后一 ...
- eclipse 远程文件实时同步,eclipse远程部署插件
[转自] http://zhwj184.iteye.com/blog/1842730 eclipse 远程文件实时同步,eclipse远程部署插件 github地址:https://github.co ...
- 菜鸟教程工具(三)——Maven自己主动部署Tomcat
书连接至背面,在博客上,他介绍了如何使用Maven该项目包,这篇文章说,关于如何使用Maven会踢war部署包Tomcat.而不是手动copy过去. 眼下比較流行的方式有两种:一种是利用Tomcat官 ...
- Maven Cargo 远程部署到tomcat7x
pom.xml中加入cargo的Plugin声明: <plugin> <groupId>org.codehaus.cargo</groupId> <artif ...
- Eclipse远程调试Tomcat
1.Linux服务器中在Tomcat的catalina.sh文件添加如下内容: CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,ad ...
- 使用IDEA远程部署tomcat和调试
环境: CentOS 7 Tomcat 9.0.1 jdk-9.0.1 IntelliJ IDEA 2017.3 Tomcat中的配置 在catalina.sh文件中加入以下的配置 CATALINA_ ...
- 使用eclipse远程调试Tomcat的方法
tomcat是一种非常常见的java web应用服务器,有时候服务器可能并不是部署在本地,而是部署在远程其他的机器上,我们用eclispe该如何进行debug调试呢? 1. 在eclispe中新建we ...
- java远程调试(断点)程序/tomcat( eclipse远程调试Tomcat方法)
tomcat远程调试: 1.Linux中配置tomcat在catalina.sh中添加如下CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_soc ...
随机推荐
- 13.以太坊中web3访问合约账户出现问题——2019年09月29日
title: 合约交互时发现访问不了地址的bug date: "2019-09-29 10:17:16" tags: Dapp开发 categories: 技术驿站 在编写合约交互 ...
- FMXUI ANDROID下连续按多次返回出现异常
在ANDROID下,按返回键后,默认是关闭当前Frame,但连接按返回键,会对当前Frame执行多次关闭动作,因为已经释放过对象,再次关闭会出现异常错误,解决办法:定义一个标识如FClosed: ...
- CNN笔记:通俗理解卷积神经网络
CNN笔记:通俗理解卷积神经网络 2016年07月02日 22:14:50 v_JULY_v 阅读数 250368更多 分类专栏: 30.Machine L & Deep Learning 机 ...
- JS中数据结构之集合
集合(set)是一种包含不同元素的数据结构.集合中的元素称为成员.集合的两个最重要特性是:首先,集合中的成员是无序的:其次,集合中不允许相同成员存在.当你想要创建一个数据结构用来保存一些独一无二的元素 ...
- AIZU 2560 [想法题]
表示敲完多项式乘法&高精度乘法两道FFT模板题后就开始来磕这题了 这题相对而言应该不算模板题 不过神犇们肯定还是一眼看穿 如果原OJ访问速度较慢的话可以考虑戳这里 http://acm.hus ...
- Linux awk 命令 说明
一. AWK 说明 awk是一种编程语言,用于在linux/unix下对文本和数据进行处理.数据可以来自标准输入.一个或多个文件,或其它命令的输出.它支持用户自定义函数和动态正则表达式等先进功能,是l ...
- 12. I2C-EEPROM
12.1. I2C 协议简介 I 2 C ( Inter-Integrated Circuit )协议是由 Phiilps 公司开发的,由于它具引脚少,硬件实现简单,可扩展性强,不需要如 USART. ...
- Leaflet-Leafletv0.7使用leaflet-bing-layer
digidem/leaflet-bing-layer: Bing Maps Layer for Leaflet v1.0.0:从标题就可以看出要Leaflet v1.0.0才能用.其实leaflet ...
- git push github 免输入账号和密码方法
git config --global credential.helper store 打开~/.gitconfig文件,会发现多了一项: [credential] helper = store 此时 ...
- css缓存问题
频繁更换样式,会导致样式缓存, 在实际项目开发过过程中,页面是上传到服务器上的.而为了减少服务器的压力,让用户少加载,浏览器会将图片.css.js缓存到本地中,以便下次访问网站时使用.这样做不仅减少了 ...