Continuum on Tomcat
Continuum 1.1-SNAPSHOT on Tomcat 5.x and 6.x
These instructions explain how to deploy the (unreleased) Continuum 1.1-SNAPSHOT web application in an existing installation of Tomcat 5.x and Tomcat 6.x.
1. Build Continuum or obtain a pre-built snapshot.
2. Locate the continuum-webapp-1.1-SNAPSHOT.war file.
(If you built Continuum, it will be in continuum-webapp/target.)
(If you have downloaded Continuum, it will be in continuum-1.1-XXX/apps/continuum-plexus-application-1.1-XXX.jar/lib/.)
3. Add a context configuration file for the web application:
For Tomcat 5.0.x
$TOMCAT_HOME/conf/Catalina/localhost/continuum.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/continuum"
docBase="/path/to/continuum-webapp-1.1-SNAPSHOT.war">
<Resource name="jdbc/users" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/users">
<parameter><name>driverClassName</name><value>org.apache.derby.jdbc.EmbeddedDriver</value></parameter>
<parameter><name>url</name><value>jdbc:derby:/path/to/data/database/users;create=true</value></parameter>
<parameter><name>username</name><value>sa</value></parameter>
<parameter><name>password</name><value></value></parameter>
<parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
</ResourceParams>
<Resource name="jdbc/continuum" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/continuum">
<parameter><name>driverClassName</name><value>org.apache.derby.jdbc.EmbeddedDriver</value></parameter>
<parameter><name>url</name><value>jdbc:derby:/path/to/data/database/continuum;create=true</value></parameter>
<parameter><name>username</name><value>sa</value></parameter>
<parameter><name>password</name><value></value></parameter>
<parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
</ResourceParams>
<Resource name="mail/Session" auth="Container" type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter><name>mail.smtp.host</name><value>smtp.coltfrance.com</value>
</parameter>
</ResourceParams>
</Context>
For Tomcat 5.5.x
$TOMCAT_HOME/conf/Catalina/localhost/continuum.xml
For Tomcat 6.0.x
$TOMCAT_HOME/webapps/continuum-webapp-1.1-SNAPSHOT/META-INF/context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/continuum"
docBase="/path/to/continuum-webapp-1.1-SNAPSHOT.war">
<Resource name="jdbc/users" auth="Container" type="javax.sql.DataSource"
username="sa"
password=""
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:/path/to/data/database/users;create=true" />
<Resource name="jdbc/continuum" auth="Container" type="javax.sql.DataSource"
username="sa"
password=""
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:/path/to/data/database/continuum;create=true" />
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"
mail.smtp.host="localhost"/>
</Context>
WARNING: The Tomcat 5.5.20 release is missing MailSessionFactory and a few other classes. JNDI mail sessions will not work. Either use Tomcat 5.5.17 or see Bug 40668 for a workaround.
4. Place the following jars in $TOMCAT_HOME/common/lib(Tomcat 5.x) $TOMCAT_HOME/lib(Tomcat 6.x):
(click the links to download each jar from the central Maven repository)
- Derby 10.1.3.1 derby-10.1.3.1.jar
- Java Mail 1.4 mail-1.4.jar
- Java Activation Framework 1.1 activation-1.1.jar
5. Start Tomcat
6. Access the application at http://localhost:8080/continuum
Optional Configuration
- Override the "To:" address for all mail sent from Continuum. Modify the <code><to-override></code> element in <code>$TOMCAT_HOME/webapps/continuum/WEB-INF/classes/META-INF/plexus/application.xml</code> and provide an alternate email address.
<plexus> ... <component> <role>org.codehaus.plexus.notification.RecipientSource</role> <implementation>org.apache.maven.continuum.notification.ContinuumRecipientSource</implementation> <configuration> <!-- Setting this propery will make Continuum send all emails to this address instead the address specified in the project configuration --> <to-override>myself@example.com</to-override> </configuration> </component> ... </plexus>
Questions
An ${appserver.base} directory is being created in $TOMCAT_HOME/bin
Derby Database File Locations
Instead of absolute paths, you can use a relative location for the database in the connection strings: jdbc:derby:users;create=true and jdbc:derby:continuum;create=true
To control where Derby creates the databases, "You define the system directory when Derby starts up by specifying a Java system property called derby.system.home." as described here : derby dev guide
Updating a Tomcat Deployment
In preparation for deploying a new snapshot of Continuum 1.1
Stop Tomcat, and delete the following files and directories:
- $TOMCAT_HOME/webapps/continuum
- $TOMCAT_HOME/work/Catalina/localhost/continuum
There may also be a $TOMCAT_HOME/bin/${appserver.base} directory. (This should not be happening.)

Comments (1)
Sep 13, 2007
Thijs Schnitger says:
I had to add 2 JAVAOPTS to my Tomcat startup script to get it to work: \Dp...I had to add 2 JAVA_OPTS to my Tomcat startup script to get it to work:
-Dplexus.system.path=$PATH to get Continuum to find the mvn and ant executables,
-Dappserver.base=$CATALINA_HOME to get the logfile in the right dir and remove the ${appserver.base} dirs popping up in $CATALINA_HOME and the appBase of my Tomcat host.