cargo-maven2-plugin上传部署到tomcat服务器
2017-03-28 16:08
483 查看
使用的是cargo-maven2-plugin插件,较为灵活的一个Deploy插件,具体配置如比上面的tomcat-maven-plugin稍微有点儿复杂,部分还有不清楚,先写上以后再慢慢研究,配置如下:
Xml代码
<build>
<plugins>
<plugin>
<!-- 指定插件名称及版本号 -->
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0.3</version>
<!-- 插件的Tomcat6.x配置 -->
<configuration>
<wait>true</wait> <!--是否说明,操作start、stop等后续操作必须等前面操作完成才能继续-->
<container> <!-- 容器的配置 -->
<containerId>tomcat6x</containerId>
<!-- 指定tomcat版本 -->
<type>installed</type> <!-- 指定类型:standalone, installed等 -->
<home>E:\webServers\apache-tomcat-6.0.32-test</home> <!-- 指定Tomcat的位置,即catalina.home -->
</container>
<configuration> <!-- 具体的配置 -->
<type>existing</type> <!-- 类型,existing:存在 -->
<home>E:\webServers\apache-tomcat-6.0.32-test</home> <!-- Tomcat的位置,即catalina.home -->
<properties> <!-- 配置属性 -->
<cargo.tomcat.manager.url>http://localhost:8080/manager</cargo.tomcat.manager.url> <!-- 管理地址 -->
<cargo.remote.username>tomcat</cargo.remote.username> <!-- Tomcat用户名 -->
<cargo.remote.password>tomcat</cargo.remote.password> <!-- Tomcat密码 -->
<cargo.tomcat.ajp.port>8009</cargo.tomcat.ajp.port> <!-- Ajp端口 -->
</properties>
</configuration>
<deployer> <!-- 部署配置 -->
<type>installed</type> <!-- 类型 -->
<deployables> <!-- 部署设置 -->
<deployable> <!-- 部署的War包名等 -->
<groupId>org.test</groupId>
<artifactId>testwebapp</artifactId>
<type>war</type>
<properties>
<context>testwebapp</context> <!-- 部署路径 -->
</properties>
</deployable>
</deployables>
</deployer>
</configuration>
<executions>
<!-- 执行的动作 -->
<execution>
<id>verify-deployer</id>
<phase>install</phase> <!-- 解析install -->
<goals>
<goal>deployer-deploy</goal>
</goals>
</execution>
<execution>
<id>clean-deployer</id>
<phase>clean</phase>
<goals>
<goal>deployer-undeploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
不详细的解释在XML当中,直接运行mvn install OK!~~
Xml代码
<build>
<plugins>
<plugin>
<!-- 指定插件名称及版本号 -->
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0.3</version>
<!-- 插件的Tomcat6.x配置 -->
<configuration>
<wait>true</wait> <!--是否说明,操作start、stop等后续操作必须等前面操作完成才能继续-->
<container> <!-- 容器的配置 -->
<containerId>tomcat6x</containerId>
<!-- 指定tomcat版本 -->
<type>installed</type> <!-- 指定类型:standalone, installed等 -->
<home>E:\webServers\apache-tomcat-6.0.32-test</home> <!-- 指定Tomcat的位置,即catalina.home -->
</container>
<configuration> <!-- 具体的配置 -->
<type>existing</type> <!-- 类型,existing:存在 -->
<home>E:\webServers\apache-tomcat-6.0.32-test</home> <!-- Tomcat的位置,即catalina.home -->
<properties> <!-- 配置属性 -->
<cargo.tomcat.manager.url>http://localhost:8080/manager</cargo.tomcat.manager.url> <!-- 管理地址 -->
<cargo.remote.username>tomcat</cargo.remote.username> <!-- Tomcat用户名 -->
<cargo.remote.password>tomcat</cargo.remote.password> <!-- Tomcat密码 -->
<cargo.tomcat.ajp.port>8009</cargo.tomcat.ajp.port> <!-- Ajp端口 -->
</properties>
</configuration>
<deployer> <!-- 部署配置 -->
<type>installed</type> <!-- 类型 -->
<deployables> <!-- 部署设置 -->
<deployable> <!-- 部署的War包名等 -->
<groupId>org.test</groupId>
<artifactId>testwebapp</artifactId>
<type>war</type>
<properties>
<context>testwebapp</context> <!-- 部署路径 -->
</properties>
</deployable>
</deployables>
</deployer>
</configuration>
<executions>
<!-- 执行的动作 -->
<execution>
<id>verify-deployer</id>
<phase>install</phase> <!-- 解析install -->
<goals>
<goal>deployer-deploy</goal>
</goals>
</execution>
<execution>
<id>clean-deployer</id>
<phase>clean</phase>
<goals>
<goal>deployer-undeploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
不详细的解释在XML当中,直接运行mvn install OK!~~
相关文章推荐
- maven工程部署到tomcat服务器上:maven+tomcat6-maven-plugin
- 基于maven-cargo-plugin 的tomcat7.x热部署记录
- maven 配置tomcat插件实现热部署,上传代码到服务器。
- 上传图片到tomcat服务器(tomcat7-maven-plugin)
- 使用cargo-maven2-plugin插件自动化发布到Tomcat服务器
- Eclipse部署Maven web项目到tomcat服务器 问题
- 在eclipse下创建maven项目并部署到tomcat服务器下
- 在Parallels Desktop上安装Cent OS并部署服务器环境(Linux, JDK, tomcat, mysql, Jenkins, git, maven)全记录
- 用 Maven 部署 war 包到远程 Tomcat 服务器
- tomcat7-maven-plugin插件把web应用一键式的部署到一个远程的tomcat中
- eclipse部署maven web项目到tomcat服务器时,没有将lib、web.xml复制过去的解决办法
- Maven配置将war包部署到Tomcat(tomcat7-maven-plugin)
- Maven项目热部署,修改代码后不用重启tomcat服务器
- Maven插件wagon-maven-plugin自动化部署Java项目到Linux远程服务器
- Maven集成 tomcat7-maven-plugin 部署Maven Web项目
- maven tomcat plugin实现热部署
- 使用tomcat7-maven-plugin部署Web项目
- maven tomcat plugin实现热部署
- 用Maven部署war包到远程Tomcat服务器
- 用 Maven 部署 war 包到远程 Tomcat 服务器