Introduction
After setting up a basic OpenCms project with OpenCms-Maven, developers can start customizing and extending it. Therefore OpenCms-Maven provides tools to synchronize the changes in the OpenCms installation with your workspace and vice versa.
Project structure
Every OpenCms-Maven project must have a minimal project structure that consists of four or five different subprojects. These projects are:
Project name –> Output
- parent –> none
- webapp –> war file
- system –> VFS resources
- content –> VFS resources
- orgunits –> VFS resources
Each sub project contains its own POM file which defines the type of the project and the actions that should take place while building.
parent
The parent project actually contains only one interesting resource – the so called parent POM file. This file declares settings which are global for the whole OpenCms project. Other POM files in the subprojects have this file declared as their parent. The parent POM finally defines the structure of the whole Maven project. For example, if a new subproject should be added to the project the new project would have been included in a special section within the parent POM.
The parent project’s directory is also the only entry point for some actions like cleaning and building the whole project.
webapp
Contains the webapplication itself and starts an instance of OpenCms in the background that is used by the VFS plugin to access the VFS. It also executes basic functions of the VFS modules:
- The basic intializing of the VFS
- Importing of user and group data
system
The system project contains all OpenCms ressources beneath the /system folder (excluding custom modules).
content
The content project contains ordinary user content. By default it synchronizes all resources of the default site.
orgunits
Creates and synchronizes organization units of the system.
Development cycle
After having a running OpenCms installation changes at the system normally are applied by an iterative development cycle.
The cycle begins by updating the current workspace on the RFS with a source control management client (for example Subversion or the Subversive plugin for eclipse). To apply these changes the synchronization mechanism of the OpenCms-Maven VFS plugin has to be triggered next. After synchronizing the ressources within the OpenCms VFS should be the same as in the SCM. Changes in the VFS are not published immediately so if you need them in the online project you have to publish them manually.
The system should be now in a „clean“ state. That means the developer can now begin to modify VFS resources. After modification a new call of the synchronization mechanism will write the new modifications from the VFS to the right place RFS. The developer can then use the SCM client again to commit the changes to the repository.