This page covers the build process for OpenCms versions since 7.0.2. For older versions please refer to this page.
OpenCms provides a source code distribution that you can use to build the OpenCms core. This is only needed if you want to add your own core extensions. To develop the usual kind of website functionality, you should use the OpenCms module mechanism which is much easier to start with and also better documented. Before even considering starting to work on the core, you definitely should have written some OpenCms modules to understand the separation between a module and and a core extension.
The OpenCms core comes with the best possible documentation: The source code itself ;-) This is really not something for the novice Java developer. However, if you have some experience in Java, Java Servlets, JDBC, and XML in general you might take a look. As said before, you should also have already a firm understanding of the OpenCms module API.
Since this is rather deep stuff targeted rather at experts than at beginners, we will not explain every detail of the process. You have been warned.
Note: In case you are using the Eclipse Platform for development, you don't need an installation of Ant, it is included in Eclipse.
Apache Ant is a Java based build tool. In theory it is kind of like make without make's wrinkles. You need Ant version 1.6 or later to build the OpenCms core. Ant is part of the Jarkarta Apache Project and can be downloaded here. Please check the Ant documentation to make sure you understand the basic principles behind Ant.
Ant installation is described in the Ant manual. It requires that you have set up your path to Java correctly. Make sure Ant runs before proceeding.
Check out the latest OpenCms source distribution from the repository as described here. It contains all classes necessary to build the OpenCms core. You will then end up with the following structure in your work directory:
/opencms /lib/compile <= Necessary libraries for compilation /lib/runtime <= Necessary runtime libraries /modules <= Module resources /src <= OpenCms Core source tree /src-components <= Component sources (Upload applet, Ant tasks) /src-modules <= Module sources /src-setup <= Setup/Update Wizard sources /test <= JUnit test sources /webapp <= OpenCms web application /webapp/setup <= Setup Wizard web application /webapp/update <= Update Wizard web application build.xml <= Ant build script
Ok this is the easy part. Call up a commandline, move to the
/opencms directory (where the file
build.xml resides) of the OpenCms source tree. In your commandline, enter the following:
That's it! This will build a complete OpenCms distribution. This will create a new
/buildcms directory (at the same level as the
/opencms directory) and will look like this after Ant is finished:
/opencms <= Unchanged /buildcms <= New created directory /build <= Contains the compiled OpenCms classes and jar files /zip <= The OpenCms distribution files will be placed here
The final result of the compilation will be a ZIP file which will be placed in the
/zip directory. This ZIP is exactly the same layout as the OpenCms binary distributions, so it will contain the
Now that you have your new OpenCms binary distribution, you simply need to follow the Server installation guide for your server setup. Please make sure you don't mess up any existing installation. Best have a separate machine that is used only for testing and development.
There are several more targets in the
build.xml that might be useful for you. Here's a short overview:
opencms.war, but does not create the binary distribution ZIP file.
CATALINA_HOME), calling this target will have Ant updating the OpenCms classes on your machine. This is done by replacing the files in the Tomcat
webapps/opencmsdirectory. If you have renamed
opencms.war, or if your Tomcat is not installed the usual way, you will have to overwrite some build properties, like
May 8, 2013 - After the great success on CeBIT 2013 Alkacon Software and the OpenCms community will present OpenCms in the CMS Garden at the LinuxTag 2013. This year’s LinuxTag takes place from May 22 to May 25, 2013. The CMS Garden is located in Hall 7 on the Berlin Fairgrounds.
Mar 15, 2013 - This years` OpenCms Days will take place from September 30 to October 1, 2013 in Cologne, Germany. The main topic of the 5th edition of the international user conference and expo will be the release of OpenCms 9.
Feb 26, 2013 - Alkacon Software and the OpenCms community will present OpenCms in the CMS Garden at the CeBIT 2013. CeBIT in Hannover is the world’s largest IT trade fair. This year’s CeBIT takes place from March 5 to March 9, 2013. The CMS Garden is located in Hall 6, close to the open source park. Check out OpenCms in the CMS garden @ CeBit 2013 in Hannover.
Feb 8, 2013 - OCEE is a commercial extension for OpenCms that offers Support for LDAP, Clustering, Replication and accelerated page load times. OCEE increases scalability, availability and fail-over security for mission-critical and high-traffic OpenCms sites.