Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
daemon
daemon

Daemon Archetype

Shows how to configure Cargo and Maven2 to use the Cargo Daemon's features in order to remotely start the container, deploy your deployable on it, do some tests, and shut the server down remotely. To run it, execute (one one line):

Code Block
 mvn archetype:generate -DarchetypeGroupId=org.codehaus.cargo
                        -DarchetypeArtifactId=cargo-archetype-daemon
                        -DarchetypeVersion=<version>

where <version> is the version of the Cargo Archetype, as a result the CARGO version to use.

The Maven archetype plugin will then ask you what groupId, artifactId, version, and package you would like to use for generation. Once your Maven project is generated, you need to first start the Cargo Daemon. Then, simply run:

Code Block
 mvn clean verify -Dhostname=<daemon.hostname> -Ddaemon.port=<daemon.port>

where <daemon.hostname> is the hostname / IP address of the machine running the Cargo Daemon and <daemon.port> the port for it.That command will:

  • Build the web application
  • If needed, download Jetty
  • Send the downloaded Jetty package to the remote Cargo Daemon instance
  • Configure Jetty on the remote machine
  • Start the Jetty container on the remote machine
  • Deploy your web application to the Jetty container on the remote machine
  • Run some tests on the deployed application
    • We've used classic JUnit tests, but you can use whatever you like, really
  • Stop the Jetty container on the remote machine

The archetype actually ships with Maven profiles for the jetty7x (default), jetty6x, tomcat6x, jonas5x, jboss51x, jboss71x, glassfish3x and geronimo3x containers.

You can of course add and use any other container from the Containers list.