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- ...
随机推荐
- [译]Domain Events Pattern Example
原文 完整源码 本文展示的是一个关于网上调查的项目.想象下,当用户完成了一个调查,我们想通知所有人调查已经结束,分配一个人去检查调用问卷. 领域对象 public class Survey { pub ...
- Java SE之反射技术[Class,Field](一)
一.什么是反射? 反射库(Reflection Library)提供了一个非常丰富且精心设计的工具集,以便编写能够动态操纵Java代码的程序.这项功能被大量地应用在JavaBeans中,它是Java组 ...
- webpack学习笔记——打包js
1.新建一个入口js文件,如entry.js,代码如下: document.write("It works.") 2.然后编译 entry.js 并打包到 bundle.js(会自 ...
- Expression知识
http://www.cnblogs.com/Ninputer/archive/2009/08/28/expression_tree1.html#!comments
- jQuery动态改变input框的属性
- shiro 启动异常
原因是:LoginController中用到,自动注入,要配置在 /permission1110/config/spring/applicationContext-service.xml中配置bean ...
- HttpClient和HttpURLConnection的使用和区别
https://www.cnblogs.com/liushuibufu/p/4140913.html 功能用法对比 从功能上对比,HttpURLConnection比HttpClient库要丰富很多, ...
- vue购物车实战项01
1. 关于挂载点 2.图片路径 这样的引入方式 是直接文件夹下myVue 3.import 不能用绝对路径 只能用相对路径 图片可以绝对路径 4.引入组件步骤 1.引入组件 @的含义在配置里面可以 ...
- Css - 页面标签页图标
Css - 页面标签页图标 <head> <meta charset="utf-8" /> <title>京东(JD.COM)- ...
- view类初探(一)
/*************************************************************************************************** ...