Description

Archetype Project to create an OpenCms Module with Maven.

OpenCms is a Content Management System that is based on Open Source Software. Complex Intranet and Internet websites can be quickly and cost-effectively created, maintained and managed.

Usage

This archetypes allows you to generate a template for an OpenCms Module Package.
So, creating the template of the application is as easy as executing:

mvn archetype:generate -DarchetypeCatalog=http://bp-cms-commons.sourceforge.net/m2repo

Select option 1, set properties and that's all!

if you have problems (folder names like '__artifactId__' ) try the full qualified name of the archetype Plugin:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeCatalog=http://bp-cms-commons.sourceforge.net/m2repo

Example Properties to set

after calling 'mvn archetype:generate' the following Properties must be defined.

        Choose archetype:
        1: ... -> opencms-module-archetype (Archetype Project to create an OpenCms Module with Maven.)
        Choose a number:  (1): 1
        Define value for projectName: : Demo Module Content
        Define value for groupId: : at.infonova.opencms.modules.demo
        Define value for artifactId: : at.infonova.opencms.modules.demo.content
        Define value for version:  1.0-SNAPSHOT: :
        Define value for package:  at.infonova.opencms.modules.demo: : at.infonova.opencms.modules.demo.content

The artifactId should be a full qualified name. This will be the name of your OpenCms Module.

Features

  • Quickstart:
    After generating your module, you can now create an working Module with "mvn install". It generates a JAR and a ZIP archiv. The ZIP-Archiv can be imported into OpenCms.
    "mvn eclipse:eclipse" generates your Eclipse configurations and classpath. It attaches also the OpenCms-Sources to the Libraries.
  • Maven:
    The generated Module is completly build with Maven.
    So you can use all Maven-Report Plugins you want.
    The Maven Release-Plugin works also fine.
  • Unit-Test Support:
    This Archetype generate an OpenCms Module Action implementation "ModuleAction.java" and a JUnit Test "OpenCmsModuleTest.java" for it.
    The Cobertura Test Coverage Report produce an report with 100% line coverage (the five lines of the hello world example).