You can get Cocoon as a release version, or you can get the bleeding edge and pull it straight from the SVN. We'll describe both methods. For this tutorial we assume you use a recent release version. At the time of writing this tutorial it is 2.1.7.
Get the release version
Download the release version from http://cocoon.apache.org/mirror.cgi and download the file that suits you best (Linux/Unix vs. Windows). Since we assume a Windows environment, we choose the zip file.
Extract the zip file in the root of your drive, e.g. D:\
Once again, it is not essential to extract the zip file in the destination given. What we suggest here is merely for the convenience of the tutorial. If you decide to install it in another location, you will need to 'translate' the location to your situation.
The root directory of this version is now D:\cocoon-2.1.7. We will refer to this directory as COCOON_HOME.
Get the SVN version
If you want the SVN version of Cocoon and you're using Eclipse 3.X as we do in this tutorial, the easiest way to get Cocoon from the repository is through the use of the Subclipse plugin.
- Start Eclipse
- Select Windows menu, Open perspective
- This can also be done through the first icon on the tab to the right of the toolbar. This icon is the first on this tab: .
- Select SVN Repository Exploring
- Right-click in the lefthand view under SVN Repository.
- Select New, Repository Location...
- Fill in the URL: http://svn.apache.org/repos/asf/cocoon
- Leave the username and password fields empty.
- Click Finish
- You now have an entry with the same name as the URL.
- Click on the plus sign to open the repository.
- Open branches This is the part that contains the code for the next release. Trunk contains code for the next version (i.e. 2.2).
- Right-click BRANCH_2_1_X
- Select Check out as...
- After a while Eclipse shows a dialog box. Select Java project. Select Next.
- Choose a name for the project. I chose SVNCocoon.
- Under Location I prefer to choose a location outside the workspace.
This allows me to include the project more easily in various sets of workspaces.
So choose Create project at external location.
Eclipse supports multiple workspaces. You can either open multiple instances of Eclipse, each with a different workspace, or you can switch workspace (File, Switch workspace...) in your current Eclipse instance. Workspaces contain a specific set of project(s) and Eclipse settings.
- Enter a convenient directory. I chose D:\SVN\cocoon.
- Select Create separate source and output folders and click Next.
- Select Finish.
- Eclipse now wants to switch to the Java perspective. Click Yes.
- Now, the entire project will be downloaded from the SVN repository. Since Cocoon is a large project, this will take a while. In the Console View (bottom part) you can see what is going on. When finished, it shows a line like:
Checked out revision 2007.
You now have a project SVNCocoon in your Package Explorer.
In this case COCOON_HOME is D:\SVN\cocoon.