Automated deployment with Cargo

Automated deployment with Cargo

    Cargo is a set of tools to help users operate Web containers, it can help users to achieve automated deployment, and it supports almost all Web windows, such as Tomcat, JBoss, Jetty and Glassfish.
    Deploy to a local web container:
    Cargo supports two local deployment methods, namely standalone mode and existing mode. In standalone mode, Cargo will copy a configuration from the installation directory of the web container to the directory specified by the user, and then deploy the application on this basis. Each time it is rebuilt, this directory will be emptied and all configurations will be regenerated. Moreover, in the existing mode, the user needs to specify the existing web container configuration directory, and then Cargo will directly use these configurations and deploy the application to its corresponding location.
    Set the following in pom.xml:
    <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven2-plugin</artifactId>
              <version>1.0</version>
              <configuration>
                  <container>
                      < containerId>tomcat5x</containerId>
                      <home>D:\Tomcat 5.5</home>

                  <configuration>
                      <type>standalone</type>
                      <home>${project.build.directory}/tomcat5x</home>
                  </configuration>
              </configuration>
      </plugin>
    set in settings.xml as follows:
    <pluginGroups >
          <pluginGroup>org.codehaus.cargo</pluginGroup>
</pluginGroups>
Let Cargo start Tomcat and deploy the application, run:
mvn cargo:start

To deploy the application directly to the existing web container, you need to configure Cargo to use the existing mode , as follows:
    <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven2-plugin</artifactId>
              <version>1.0</version>
              <configuration>
                  <container>
                      <containerId>tomcat5x</containerId>
                      <home>D:\Tomcat 5.5</home>
                  </container>
                  <configuration>
                      <type>existing</type>
                      <home> D:\Tomcat 5.5 </home>
                  </configuration>
              </configuration>
      </plugin>

部署至远程Web容器:
<plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven2-plugin</artifactId>
              <version>1.0</version>
              <configuration>
                  <container>
                      <containerId>tomcat5x</containerId>
                      <type>remote </type>
                  </container>
                  <configuration>
                      <type>runtime</type>
                      <properties>
                        <cargo.remote.username>admin</cargo.remote.username>
                        <cargo.remote.password>admin123</cargo.remote.password>
                        <cargo.tomcat.manager.url>
http://192.168.0.100/manager
</cargo.tomcat.manager.url>
</properties>
                  </configuration>
              </configuration>
      </plugin>     mvn cargo:redeploy
    to have Cargo deploy the application, run the command:

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327070668&siteId=291194637