Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project Resource: Cannot invoke Tomcat manager: Connection refused: connect -> [Help 1]
1、问题描述
在 DOS 下执行 tomcat7-maven-plugin 插件部署,启动 Apache Tomcat 服务报错如下:
D:\2018\code\XXX>mvn tomcat7:deploy
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< org.cqupt.mauger:Resource >----------------------
[INFO] Building Resource 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
...
...
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project Resource: Cannot invoke Tomcat manager: Connection refused: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
2、分析原因
出现该问题的主要原因是:apache tomcat 没有找到 JAVA_HOME 和 JRE_HOME,并且 tomcat 没有配置环境变量,从而导致启服失败!
3、解决方法
1)下载 JDK 并配置环境变量
2)下载 Apache Tomcat 并且配置好环境变量
3)接下来 Clean Maven 工程 Maven —> Update Project,重新进行部署即可!(这里我的是先启动 Tomcat 服务,然后才进行部署 mvn tomcat7:deploy)
4)取消部署时应先执行 mvn tomcat7:undeploy,再关闭 Tomcat 服务。
【JDK 与 Tomcat 环境配置 (这里是 Windows)】
4、命令部署
| 命令 | 描述 |
|---|---|
| tomcat7:run | 运行当前项目 |
| tomcat7:deploy | 部署当前项目 |
| tomcat7:redeploy | 重新部署项目 |
| tomcat7:exec-war | 创建一个可执行的jar文件,允许使用java -jar mywebapp.jar 运行web项目 |
| tomcat7:undeploy | 取消部署一个war |
| tomcat7:help | 在tomcat7-maven-plugin显示帮助信息 |
Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project Resource: Cannot invoke Tomcat manager: Connection refused: connect -> [Help 1]的更多相关文章
- Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (dist) on project hadoop-kms: An Ant BuildException has occured
编译cdh版hadoop2.5.0出现的问题 系统: CentOs66 64位 JDK:1.7 Maven: 3.0.5 Protobuf: libprotoc 2.5.0 编译命令: mvn pac ...
- Maven Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean Failed to delete access_log
I'm trying to run simple struts project using maven and tomcat. When I'm trying to exucute next goal ...
- Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-
Maven项目报错:Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clea ...
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile
完整的错误信息: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile ( ...
- Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean)
eclipse在使用maven的tomcat控件编译java程序时,报错 Failed to execute goal org.apache.maven.plugins:maven-clean-plu ...
- Maven clean命令不能执行问题Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project
执行clean tomcat7:run时Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (de ...
- Maven项目报错:Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clea
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) ...
- maven 编译出错 Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean
eclipse在使用maven的tomcat控件编译java程序时,报错 Failed to execute goal org.apache.maven.plugins:maven-clean-plu ...
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project web_nanchang
maven打包成war时,报错:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default- ...
随机推荐
- 【bzoj 4756】[Usaco2017 Jan] Promotion Counting
Description The cows have once again tried to form a startup company, failing to remember from past ...
- MVC 自定义路由
RouteConfig.cs 代码如下: public class RouteConfig { public static void RegisterRoutes(RouteCollection ro ...
- [C++]2-6 排列
/* 排列(Permutation) 用1,2,3,...,9组成3个三位数abc,def和ghi,每个数字恰好使用一次,要求abc:def:ghi = 1:2:3. 按照"abc def ...
- 使用IDEA新建Web工程启动报404的错误
新换了一个项目组被人吐槽配置文件都能写错,所以打算从头开始一步步搭建一个项目,包含ssm基础框架.mongodb工具类.redis工具类.jsf配置.log配置等 今天先来搭建一个web工程.工程搭建 ...
- whatis命令,一个非常有用的命令
比如我不知道yum的配置文件yum.conf怎么用,就可以whatis yum.conf,
- CentOS 7安装Redis
第一步:安装gcc依赖 先通过gcc -v是否有安装gcc,如果没有安装,执行命令 yum install -y gcc(yum install -y gcc-c++) 第二步:下载redis安装包 ...
- Java内存模型[转]
原文:http://www.cnblogs.com/nexiyi/p/java_memory_model_and_thread.html 1. 概述 多任务和高并发是衡量一台计算机处理器的能力重要指标 ...
- 【Linux】CentOS7.0下安装JDK环境
写在前面:此次试验是在CentOS7上面安装的,亲测成功. 所需工具:JDK1.8安装包,xftp 具体步骤: 1,首先使用xftp连接到自己的虚拟机,然后查看是否有"/usr/java/j ...
- webstorm的快捷键总结
ctrl+shift+f 可以在项目和模块中的文件中查找特定字符串 shift键连续敲一下,可以在项目和模块中查找特定的文件 ctrl+d 复制当前行并粘贴到下一行 ctrl+shift+上下方向键 ...
- 用ARX自定义实体
本文介绍了构造自定义实体的步骤.必须继承的函数和必须注意的事项 1.新建一个从AcDbEntity继承的类,如EntTest,必须添加的头文件: "stdarx.h",&quo ...