Introduction
OpenCms-Maven is basically a Maven Plug-in that enables synchronization between OpenCms VFS resources and a real file system. This enables full automated builds of OpenCms from scratch from one defined repository. VFS contents can be versioned as human readable text files so all the benefits of a version control system can be used, including concurrent versioning, conflict management etc. There’s no need anymore to put binary data like db-dumps into your versioning control system.
Until OpenCms 7 some modifications of OpenCms were necessary to enable OpenCms to work with Maven. Since OpenCms 7.5 this is no longer the case. We now use the opencms.jar which is shipped with standard OpenCms.
In order to be able to build a OpenCms from scratch, we created a OpenCms distribution which is already prepared for being built with Maven. This distribution is called opencms-basic which enables to build a runnable OpenCms system with only basic modules and extensions. The opencms-basic project can be used as a starting point to create customized OpenCms installations.
Prerequisites
To use the OpenCms-Maven tool you must have the following software installed:
- JSE >= 1.4
- Maven
- Apache Tomcat >= 5.x
- MySQL or PostgreSQL database
- Client, to access your version control system (SVN, GIT etc.)
- Eclipse IDE (optional but recommended)
Also you need an Internet connection that allows http and https requests by the maven executable.
Installing Maven
To install Maven 2 or 3 just download the distribution from the Maven homepage the and extract it to a directory of your choice. For convenience you should then add the bin subdirectory of the extracted Maven directory to your PATH environment variable. For Unix like systems you can also look if Maven is supported by your distribution and use a package manager to install it.
To test if the Maven executable can be found, open a new command line interface and type mvn . You should then get a Maven error message that no parameters have been passed.
Maven creates an own directory in the user’s home path to store its configuration. By default this will be /.m2 on both Linux and Windows systems. If you’ve already run the Maven executable this directory should have been created automatically. If it doesn’t exist you can also create it manually.