pom.xml tomcat 配置信息
 <properties><project.build.sourceEncoding>utf8</project.build.sourceEncoding>//编码格式
  <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] &lt;role rolename="manager-gui"/&gt;
[INFO] &lt;user username="tomcat" password="s3cret" roles="manager-gui"/&gt;
[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的更多相关文章

  1. Maven项目远程部署到Tomcat

    目录 Maven项目远程部署到Tomcat 一.Tomcat插件支持的目标 二.系统要求及插件引入 2.1 系统要求 2.2 引入插件 三.远程部署war到tomcat 3.1 添加tomcat管理角 ...

  2. 关于在eclipse上部署Tomcat时出现8080等端口被占用问题的解决方法

    问题描述: 在eclipse中部署Tomcat时,出现如下错误. 解决方法如下: 方法一: 1.开始->cmd->输入命令netstat -ano出现下图所示(注意下边显示有些错位,最后一 ...

  3. eclipse 远程文件实时同步,eclipse远程部署插件

    [转自] http://zhwj184.iteye.com/blog/1842730 eclipse 远程文件实时同步,eclipse远程部署插件 github地址:https://github.co ...

  4. 菜鸟教程工具(三)——Maven自己主动部署Tomcat

    书连接至背面,在博客上,他介绍了如何使用Maven该项目包,这篇文章说,关于如何使用Maven会踢war部署包Tomcat.而不是手动copy过去. 眼下比較流行的方式有两种:一种是利用Tomcat官 ...

  5. Maven Cargo 远程部署到tomcat7x

    pom.xml中加入cargo的Plugin声明: <plugin> <groupId>org.codehaus.cargo</groupId> <artif ...

  6. Eclipse远程调试Tomcat

    1.Linux服务器中在Tomcat的catalina.sh文件添加如下内容: CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,ad ...

  7. 使用IDEA远程部署tomcat和调试

    环境: CentOS 7 Tomcat 9.0.1 jdk-9.0.1 IntelliJ IDEA 2017.3 Tomcat中的配置 在catalina.sh文件中加入以下的配置 CATALINA_ ...

  8. 使用eclipse远程调试Tomcat的方法

    tomcat是一种非常常见的java web应用服务器,有时候服务器可能并不是部署在本地,而是部署在远程其他的机器上,我们用eclispe该如何进行debug调试呢? 1. 在eclispe中新建we ...

  9. java远程调试(断点)程序/tomcat( eclipse远程调试Tomcat方法)

    tomcat远程调试: 1.Linux中配置tomcat在catalina.sh中添加如下CATALINA_OPTS="-Xdebug  -Xrunjdwp:transport=dt_soc ...

随机推荐

  1. pipelines和重定向命令

    pipelines: command1 | command2 例如,ls -l /usr/bin | less,将输出结果作为 less 命令的输入结果,在standard output 中显示出来. ...

  2. pycharm html 注释

    修改方式:如图修改成值None以后,command+/快捷键,html注释的符号就是<!-- 注释内容 -->:为Jinja2的时候,注释符号就是{# 注释内容 #} 修改成None时,H ...

  3. js中的回钓函数,C#中的委托

    $(function(){ myfunction(sayHi); }); var sayHi=function(){ alter('你好'); } function myfunction(a){ a( ...

  4. 分布式消息中间件及RabbitMQ

    分布式应用和集群: 从部署形态来看,它们都是多台机器或者多个进程部署,而且都是为了实现一个业务功能. 如果是一个业务被拆分成多个子业务部署在不同的服务器上,那就是分布式应用 如果是同一个业务部署在多台 ...

  5. 【Linux】grep显示匹配行的上下几行的用法

    打印匹配行的前后5行 grep -5 ‘something’ file 打印匹配行的前后5行 grep -C 5 ‘something’ file 打印匹配行的后5行 grep -A 5 ‘somet ...

  6. paper 162:卷积神经网络(CNN)解析

    卷积神经网络(CNN)解析: 卷积神经网络CNN解析 概揽 Layers used to build ConvNets 卷积层Convolutional layer 池化层Pooling Layer ...

  7. BUUCTF | CODE REVIEW 1 (反序列化,md5绕过)

    <?php /** * Created by PhpStorm. * User: jinzhao * Date: 2019/10/6 * Time: 8:04 PM */ highlight_f ...

  8. [CSP-S模拟测试]:math(裴蜀定理)

    题目传送门(内部题22) 输入格式 第一行有$2$个整数$n,k$.第二行有$n$个正整数$a_i$. 输出格式 第一行有一个整数$s$,表示可以生成的非负整数的个数.第二行有$s$个可以生成的非负整 ...

  9. APIO2010 特别行动队 & 斜率优化DP算法笔记

    做完此题之后 自己应该算是真正理解了斜率优化DP 根据状态转移方程$f[i]=max(f[j]+ax^2+bx+c),x=sum[i]-sum[j]$ 可以变形为 $f[i]=max((a*sum[j ...

  10. 测开之路四十二:常用的jquery事件

    $(‘selector’).click() 触发点击事件$(‘selector’).click(function) 添加点击事件$(‘selector’).dbclick() 触发双击事件$(‘sel ...