Maven Cargo 远程部署到tomcat7x
pom.xml中加入cargo的Plugin声明:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.9</version>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.uri>http://192.168.128.137:8080/manager/text</cargo.remote.uri>
<cargo.remote.username>admin</cargo.remote.username>
<cargo.remote.password>admin</cargo.remote.password>
</properties>
</configuration>
</configuration>
</plugin>
With Tomcat 7, the Tomcat manager has multiple aspects to be careful about:
- Your browser by default accesses the HTML-based manager whereas CARGO needs to use the text-based manager. As a result, if you want to set the
RemotePropertySet.URI
manually, please make sure you set the URL for the text-based manager, for examplehttp://production27:8080/manager/text
- The text-based manager requires to be accessed by a user with the
manager-script
role; and by default no user has that role. As a result, please make sure you modify yourtomcat-users.xml
file to give that role to a user.
You can read more in the Tomcat documentation: http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html
意思是:
- 属性cargo.remote.uri后面必须是xxx:8080/manager/text格式
- tomcat7x的权限设置和以前不一样了。要改配置给权限。可以这么改:(不管什么权限,一股脑儿全给admin再说)
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui"/>
另外,无论是博客,还是《Maven实战》都写的是用属性cargo.tomcat.manager.url。可是我看Cargo Tomcat7x文档,甚至Cargo Tomcat6x文档里面都没有提到这个属性。我一开始就用这个属性,结果总是报错,说什么Connection refused。但在这两个文档文档最下面 For remote container o.c.c.c.tomcat.Tomcat7xRemoteContainer 一栏反而有个cargo.remote.uri属性,看名字好像是一个远程uri,我试了试,竟然成功远程部署了。
所以。。。还是文档比较重要。
https://codehaus-cargo.github.io/cargo/Home.html 里面有好多容器的cargo设置。
最后,你得先保证tomcat7x是运行状态的。用
mvn cargo:redeploy 命令部署就好了。
cargo的所有goals:(具体运用中自己看吧。。。)
Goals |
Description |
---|---|
|
Start a container. That goal will:
Note: A container that's started with |
|
Start a container and wait for the user to press
|
|
Stop a container. |
|
Stop and start again a container. If the container was not running before calling cargo:restart , it will simply be started. |
|
Create the configuration for a local container, without starting it. Note that the |
|
Package the local container. |
cargo:daemon-start |
Start a container via the daemon. Read more on: Cargo Daemon Note: The |
cargo:daemon-stop |
Stop a container via the daemon. Read more on: Cargo Daemon |
|
Deploy a deployable to a running container. Note: The |
|
Undeploy a deployable from a running container. |
|
Start a deployable already installed in a running container. |
|
Stop a deployed deployable without undeploying it. |
|
Undeploy and deploy again a deployable. If the deployable was not deployed before calling |
|
Merge several WAR files into one. |
|
Installs a container distribution on the file system. Note that the |
|
Get help (list of available goals, available options, etc.). |
Maven Cargo 远程部署到tomcat7x的更多相关文章
- Maven项目远程部署到Tomcat
目录 Maven项目远程部署到Tomcat 一.Tomcat插件支持的目标 二.系统要求及插件引入 2.1 系统要求 2.2 引入插件 三.远程部署war到tomcat 3.1 添加tomcat管理角 ...
- maven eclipse远程部署tomcat
pom.xml tomcat 配置信息 <properties><project.build.sourceEncoding>utf8</project.build.so ...
- Maven: 自动远程部署
1. 在settings.xml中的Servers节点中增加Server的登录信息: <server> <id>deploy_server_65</id> < ...
- 用Maven打包成EAR远程部署JBoss(二)——部署到远程JBoss
用Maven打包成EAR远程部署JBoss(一)讲了如何使用Maven打包,可是在文章的最后也留下了一个问题,那就是如何将包部署到远程的JBoss中呢?近期在对之前的学习进行总结,发现少了这样一篇重要 ...
- 配置Tomcat、maven远程部署调试总结。
注意:可以搞两个环境,一个本地tomcat 一个服务器上的tomcat ,然后都采用如下配置.这样就可以 在本地调试,调试好后,再发布到服务器端.非常方便. ==================== ...
- Eclipse+Maven远程部署项目到Tomcat中
使用maven的自动部署功能可以很方便的将maven工程自动打包并且部署到远程tomcat服务器,省去一些繁琐的操作,节省大量时间. 我使用的tomcat版本是8.5,tomcat7和tomcat8都 ...
- maven远程部署到tomcat8服务器
maven远程部署到tomcat8服务器 环境准备 linux服务器一台 服务器安装JDK 服务器安装Tomcat 服务器Tomcat8配置 添加Tomcat权限 配置文件路径: tomcat/con ...
- 使用Maven构建和部署J2EE应用程序的EAR文件
这篇文章.主要是技术上的整理,用来mark一下,用的时候參考. 一.新建项目 新建一个空的Maven Project项目 二.放入依赖 注:ear部署时假设里面有entity,会错误发生.所以不要把e ...
- Tomcat热部署:Maven项目一键部署到Tomcat服务器 - 支持多环境
参考:Eclipse中的Maven项目一键部署到Tomcat服务器 - 支持多环境部署 命令 debug模式设置关联源码 eclipse --> 项目右键 --> Debug As --& ...
随机推荐
- spring boot项目使用swagger-codegen生成服务间调用的jar包
swagger-codegen的github:https://github.com/swagger-api/swagger-codegen 需要的环境:jdk > 1.7 maven > ...
- [原创]java WEB学习笔记42:带标签体的自定义标签,带父标签的自定义标签,el中自定义函数,自定义标签的小结
本博客为原创:综合 尚硅谷(http://www.atguigu.com)的系统教程(深表感谢)和 网络上的现有资源(博客,文档,图书等),资源的出处我会标明 本博客的目的:①总结自己的学习过程,相当 ...
- elasticsearch查询及logstash简介
Query DSL: request body: 分成两类: query dsl:执行full-text查询时,基于相关度来评判其匹配结果: 查询执行过程复杂,且不会被缓存: filter dsl:执 ...
- spring学习(2)
理解反向控制(IOC) 依赖注入(di):比IOC更好地名字.获得依赖对象的方式反转了. IOC应用 IOC或者di,还可以达到解耦的目的. spring开发提倡接口编程,配合di技术,可以更好地达到 ...
- 在Win8.1系统下如何安装运行SQL Server 2005
按正常情况,在Win8/Win8.1系统下安装微软的SQL Server 2005套件会存在兼容问题,即使安装完,最后的结果就是导致其服务项无法正常启动. 如果用户创建使用的项目非要按照SQL Ser ...
- 分享知识-快乐自己:mongodb 安装部署(linux)
1):下载 mongodb 包 [root@admin tools]# wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6. ...
- Serblet 过滤器(Filter)
Servlet 过滤器可以动态地拦截请求和响应,以变换或使用包含在请求或响应中的信息. 过滤器的作用: 1.身份验证过滤器 2.日志记录和审核过滤器 3.触发资源访问事件过滤器. 等等等... Ser ...
- 更新github上代码
前面一篇已经实现首次上传代码到github了,本篇继续讲如何把本地更新的代码同步更新到github上 一.clone代码 1.把大神的代码clone到本地,或者clone自己github上的代码,使用 ...
- 2018.5.29 从layout 到 PCBA
1 Gerber 这个网上有现成的教程:(不要写网上能找到的资料-敏捷开发) AD 导出Gerber :https://jingyan.baidu.com/article/3c48dd3494181c ...
- freeMarker(三)——模板开发指南之数值、类型
学习笔记,选自freeMarker中文文档,译自 Email: ddekany at users.sourceforge.net 模板开发指南——数值.类型 1.基本内容 1.1 什么是数值? 正如你 ...