Getting started with Cocoon
This FlashGuideTM will get you started with Apache Cocoon.
1. Building Cocoon
There are no binary distributions of Cocoon available after the 2.0.4 release (the current release is 2.1.6). If you would like a binary distribution of 2.0.4, however, it is a very stable release and I highly recommend it. Personally, I've never had reason to upgrade from that version.
- Check your prerequisites:
- Make sure you have a Java Development Kit (JDK) installed, and the environment variable $JAVA_HOME set to the JDK installation directory. You should also have the $JAVA_HOME/bin directory in your $PATH. (For Windows users, make sure you have %JAVA_HOME set and %JAVA_HOME\bin in your %PATH
Download the latest Cocoon source distribution from http://cocoon.apache.org/mirror.cgi.
Unpack the distribution in the desired directory.
Cd into the source distribution directory:
cd cocoon-2.1.6
Build Cocoon with all the defaults. On Unix, type:
./build.sh
On Windows, type:
build
Or, you can tailor the build to your needs. For example, for production use I never build the samples. So, do this on Unix:
cp blocks.properties local.blocks.properties
On Windows, type:
copy build.properties local.build.properties
Now edit the local.build.properties file and uncomment the exclusions your desire. For example, to remove samples, documentation and test files, uncomment these lines:
# ---- Webapp ------------------------------------------------------------------
exclude.webapp.documentation=true
exclude.webapp.javadocs=true
exclude.webapp.samples=true
exclude.webapp.test-suite=true
# ---- Build Exclusions --------------------------------------------------------
exclude.deprecated=true
exclude.documentation=true
exclude.javadocs=true
If you previously built Cocoon, you should run a clean first:
./build.sh clean
On Windows, type:
build clean
Now build with the new build properties:
./build.sh
On Windows, type:
build
Finally, you can run Cocoon using its built-in web server, Jetty. This server will run on port 8888 by default, so make sure that port is not already in use:
./cocoon.sh servlet
On Windows, type:
cocoon servlet
Lastly, point your browser to http://[hostname]:8888, (where "[hostname]" refers to the machine on which you are running Cocoon), to see the default Cocoon page. Even if you have built Cocoon without samples, you will get a default page.
Back to Table of Contents
|