maven项目使用cargo自动部署:
2015-05-29 17:45
661 查看
maven项目的使用cargo自动部署:
1.在maven中的seting.xml中修改节点<pluginGroups>为下面的形式:
2.pom文件中添加本地部署的配置脚本:
3.远程部署:
在tomcat的用户配置文件中加入
重启tomcat
远程部署Pom脚本
亲测可以运行成功
1.在maven中的seting.xml中修改节点<pluginGroups>为下面的形式:
<pluginGroups>
<pluginGroup>org.codehaus.cargo</pluginGroup>
</pluginGroups>
2.pom文件中添加本地部署的配置脚本:
<plugin> [code]<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.1.3</version>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<home>D:\apache-tomcat-7.0.52</home>
</container>
<configuration>
<type>existing</type>
<home>D:\apache-tomcat-7.0.52</home>
<properties>
<cargo.jvmargs>
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787
</cargo.jvmargs>
</properties>
</configuration>
</configuration>
<executions>
<execution>
<id>cargo-run</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
3.远程部署:
在tomcat的用户配置文件中加入
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="admin" roles=" admin-gui , manager-gui ,manager-script"/>
重启tomcat
远程部署Pom脚本
<!-- 远程部署 -->
<plugin>
<groupId>org.apache.maven.plugin</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.1.3</version>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.username>admin</cargo.remote.username>
<cargo.remote.password>admin</cargo.remote.password>
<cargo.remote.manager.url>http://localhost:8080/manager</cargo.remote.manager.url>
</properties>
</configuration>
</configuration>
<executions>
<execution>
<id>cargo-redeploy</id>
<phase>pre-integration-test</phase>
<goals>
<goal>redeploy</goal>
</goals>
</execution>
</executions>
</plugin>
亲测可以运行成功
相关文章推荐
- GPS坐标互转:WGS-84(GPS)、GCJ-02(Google地图)、BD-09(百度地图)
- ALT+数字,可输入汉字或拉丁字母 good
- 聚类算法教程(3):层次聚类算法Hierarchical Clustering Algorithms
- Django笔记(3)-- 模板
- Django搭建及源码分析(一)
- Logo闪白边效果
- Django国际化
- 端口复用及其实现分析[Google Patch]
- 学习Golang的步骤建议
- VDI使用Sogou 输入法无法设置并且报错
- 快速排序
- 利用djangobb快速搭建论坛
- Django笔记(2)-- 在网页中显示hello world
- Django笔记(1)
- Category
- 最大公约数与最小公倍数
- DAG问题之矩形嵌套
- Google搜索入门
- Google翻译之路
- Google类库之一的guava