您的位置:首页 > 运维架构 > Tomcat

使用Maven Cargo 插件管理Tomcat的部署

2016-06-21 19:46 381 查看
 通过这几天的学习,终于学会了自动化部署,Cargi自动化部署是一组帮助用户操作WEB容器的工具,它能够帮助用户实现自动化部署,而且它几乎支持所有容器

,Tomcat、JBoss,jetty服务器。本文章主要是基于Tomcat部署。在这里是基于Jenkins进行持续集成,Jenkins是最流行的开源持续集成服务软件,相关可见Jenkis文档。

本文介绍是maven+git+jenkis

<!-- 自动化部署 -->

        <plugin>

          <groupId>org.codehaus.cargo</groupId>

          <artifactId>cargo-maven2-plugin</artifactId>

          <version>1.4.5</version>

          <executions>

           <execution>

              <id>start-container</id>

              <phase>install</phase>

              <goals>

                <goal>run</goal>

              </goals>

            </execution>

          </executions>

          <configuration>

              <wait>false</wait>

              <container>

                  <containerId>tomcat8x</containerId>

                  <zipUrlInstaller>

                      <url>https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.0.36/bin/apache-tomcat-8.0.36.tar.gz</url>

                      <downloadDir>${project.build.directory}/downloads</downloadDir>

                      <extractDir>${project.build.directory}/extracts</extractDir>

                  </zipUrlInstaller>

                  <home>${project.build.directory}/extracts/apache-tomcat-8.0.36/apache-tomcat-8.0.36</home>

              </container>

             <configuration>

                 <type>standalone</type>

                 <home>${project.build.directory}/tomcat8x</home>

                 <properties>

                          <cargo.servlet.port>8084</cargo.servlet.port>

                          <cargo.tomcat.ajp.port>8098</cargo.tomcat.ajp.port>

                          <cargo.hostname>localhost</cargo.hostname>

                          <cargo.rmi.port>8206</cargo.rmi.port>

                          <cargo.tomcat.uriencoding>${project.build.sourceEncoding}</cargo.tomcat.uriencoding>

                    </properties>

              </configuration>

          </configuration>

          

        </plugin>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: