Here are some quick steps to follow if you wish to add support for a new container in Cargo:
- Subscribe to the cargo dev mailing list and ask as many question you'd like there!
- Create a JIRA issue on http://jira.codehaus.org (you'll need to register). I'll then add you to the cargo-developers group in JIRA and assign the issue to you
- Checkout Cargo from SVN trunk
- Have a look at existing container implementations (search for example for
Resin3xLocalContainer
orOrion2xLocalContainer
). - Create a
org.codehaus.cargo.container.containerName
package if it doesn't already exist. This package must be located in thetrunk/core/api/container
project (Note: we are in the process of moving container implementations to their own project and in the future you'll create that package intrunk/core/containers/containerName
. - Create the following classes:
- A container implementation class named
_ServerNameNxContainerType_Container
whereServerName
is the name of the container,N
the version andContainerType
the type of container (Local or Remote). For example:JBoss3xLocalContainer
. - A configuration implementation class named
_ServerNameConfigurationType_Configuration
whereConfigurationType
can beStandaloneLocal
orExistingLocal
. For exampleJBossStandaloneLocalConfiguration
. - You may need to implement some ancillary classes but those are the main 2 required. Check how the other container are implemented to see how to implement them and what other classes you may need to implement.
- A container implementation class named
- Cargo has an SPI that you should use and that should make it easy for you. Your container class should extend
org.codehaus.cargo.container.spi.Abstract_ContainerType_Container
and your configuration class should extendorg.codehaus.cargo.container.spi.configuration.Abstract_ConfigurationType_Configuration
. - Register your new classes in the generic API in the Factory classes
trunk/core/api/generic
so that users can use your new container by using the generic API. - Add your container to the tests in
trunk/samples/java
. This means editing the*Test.java
classes and adding your container in thesuite()
method. - Run the Cargo build to ensure everything is working. You'll probably find that you haven't followed the Cargo project's coding conventions... Fix those and build again until it passes!
- Register on Codehaus' confluence. Once this is done I'll add you to the cargo-developers user group so that you have the right to edit yourself the Cargo web site pages
- Document the new container on the Cargo web site
- Create a SVN patch and attach it to the JIRA issue you have created above
Thanks and happy coding!