I've committed additional improvements for Terracotta plugin for Maven 
to support Cargo for running web application containers. I will update 
plugin wiki page later today or tomorrow, but those who are interested 
can look at \tc-maven-plugin\examples\tc-maven-webapp to get a sneak 
peak. There are still issues related to CDV-444 and CDV-435, so you may 
not be able to run this stuff without some additional tweaking until 
those issues are resolved.

  It is now possible to add Cargo configuration inside <process> element 
that tells tc:run goal how to start processes with DSO enabled. There is 
a working example for Tomcat, but I haven't figured out how to run 
clustered Jetty this way. I will send a separate email about that.

  The following example will download Tomcat 5.5, install it locally, 
and start 2 nodes configured with Terracotta. Also when it is used from 
project that has war packaging it will also automatically deploy that 
war to those containers and it all done from simple "mvn tc:run"

          <plugin>
            <groupId>org.terracotta.maven.plugins</groupId>
            <artifactId>tc-maven-plugin</artifactId>
            <version>0.0.5-SNAPSHOT</version>
            <configuration>
              <processes>
                <process nodeName="cargo" count="2">
                  <container>
                    <containerId>tomcat5x</containerId>
                    <zipUrlInstaller>
                      
<url>http://www.apache.org/dist/tomcat/tomcat-5/v5.5.25/bin/apache-tomcat-5.5.25.zip</url>
                      <installDir>${user.home}/cargo/tomcat5x</installDir>
                    </zipUrlInstaller>
                  </container>
                </process>
              </processes>
            </configuration>
          </plugin>

  Note that in this case clustered tomcats will keep running and to stop 
them you could use "mvn tc:terminate".

  tc-maven-webapp also have an example how above configuration can be 
placed into a profile, so you could quickly flip app server from the 
command line "mvn -Ptomcat5x tc:run"

  There is also example how to start clustered containers for running 
integration test (see WebappTest there). Basically you can use the 
following configuration (assuming that actual processes are configured 
in a separate profiles, see tc-maven-webapp/pom.xml) and then run 
integration test using "mvn verify" command:

      <plugin>
        <groupId>org.terracotta.maven.plugins</groupId>
        <artifactId>tc-maven-plugin</artifactId>
        <version>0.0.5-SNAPSHOT</version>
        <executions>
          <execution>
            <id>run-integration</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>run-integration</goal>
            </goals>
          </execution>
          <execution>
            <id>terminate-integration</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>terminate-integration</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

  run-integration and terminate-integration goals are basically the same 
as tc:run and tc:terminate except that they are using special life cycle 
for starting/stopping DSO server. Maybe it would be better to do 
something like that instead:

          <execution>
            <id>run-integration</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>bootjar</goal>
              <goal>start</goal>
              <goal>run-bare</goal>
            </goals>
          </execution>
          <execution>
            <id>terminate-integration</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>terminate-bare</goal>
              <goal>stop</goal>
            </goals>
          </execution>

  in this case run-bare and terminate-bare won't do anything about 
starting and stopping DSO server.

  There is one thing to keep in mind. Maven terminates build after any 
failed build phase, i.e. post-integration-test phase won't be executed 
if integration-test phase failed. So, if DSO server will be brought down 
only if integration test passed. I haven't figured out yet how to 
workaround this.

  regards,
  Eugene


_______________________________________________
tc-dev mailing list
[email protected]
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to