The CQ Project Maven Archetype is a standard Maven Archetype that can be used to quickly and easily generate multi-module Maven Projects that can be used to bootstrap new Adobe CQ 5.5 development projects.
The generated Maven Project has the following characteristics:
NOTE: The CQ Project Maven Archetype is built and tested against Adobe CQ 5.5 and by default the generated project will not work with CQ 5.4 due to changes made by Adobe between the two versions. However, the basic Project layout and Maven module definitions are still valid (and recommended) for a CQ 5.4 project.
The CQ Project Maven Archetype is available from the official CQ Blueprints Maven Repository. In addition, the generated CQ project makes use of Maven Artifacts that are only available from the CQ Blueprints Maven Repository. So you need to have access to the CQ Blueprints Maven Repository configured.
If you have not already configured access to the CQ Blueprints Maven Repository, see Connecting to the CQ Blueprints Repository.
The generated CQ project also makes use of Maven Artifacts that are only available from the Adobe Maven Repository.
If you have not already configured access to the Adobe Maven Repository, see Connecting to the Adobe Maven Repository.
The CQ Project Maven Archetype is a standard Maven Archetype, so you use it just like you would any other Archetype.
Here's a step-by-step guide:
The generated project is a multi-module Maven project consisting of a parent project and 6 modules. The 6 modules each serve a different purpose and are intended to best separate the different development concerns so that Developers can work easily in parallel without tripping over each other.
What follows is a brief description of each module, the module's intent and a high level guide as to how to work with the module:
Use this module for development of CQ components, templates and designs.
As a developer you will use the vlt tool to synchronize your local CQ repository with the src/main/content/jcr_root directory of this module. The filter.xml file to control how vlt works is already correctly defined for you as part of the project generation process. You will normally NOT use Maven to do anything with this module during day-to-day local development, the Maven build will only be used when making formal releases for example where the CQ content will be bundled up into a CQ Package for deployment to QA / Staging / Production type environments.
Use this module for managing your JCR based configuration settings.
The default module generated from the Archetype demonstrates how to use the run modes feature of CQ to target configuration settings to specific environments.
As a developer you will use the vlt tool to synchronize your CQ repository with the src/main/content/jcr_root directory of this module. The filter.xml file to control how vlt works is already correctly defined for you as part of the project generation process. You will normally NOT use Maven to do anything with this module during day-to-day local development, the Maven build will only be used when making formal releases for example where the CQ content will be bundled up into a CQ Package for deployment to QA / Staging / Production type environments.
Use this module to deploy custom OSGi services to your CQ environment.
The Maven build for this module is pre-configured to use the SCR tools to automatically generate OSGi service descriptors based on Java Annotations. The default module generated from the Archetype contains various examples of Services with Annotations applied.
As a developer you WILL use Maven to build and deploy this module into your CQ environment by simply running the following Maven command:
mvn -Pauto-deploy install
The Maven build will generate all of the necessary OSGi metadata, package your OSGi bundle and deploy it to your CQ environment. Once the build process is finished, it should be as easy as hitting refresh on your browser to see the effects of your code changes.
Use this module to write your JSP Custom Tag Library classes, which will then be deployed as an OSGi bundle to your CQ environment.
The Maven build for this module is pre-configured with everything you need to write a JSP Custom Tag Library, including plugins to automate the generation of the Tag Library Descriptor (.tld) file.
As a developer you WILL use Maven to build and deploy this module into your CQ environment by simply running the following Maven command:
mvn -Pauto-deploy install
The Maven build will generate the Tag Library Descriptor, all of the necessary OSGi metadata, package your Taglib as an OSGi bundle and deploy it to your CQ environment. Once the build process is finished, it should be as easy as hitting refresh on your browser of a page that uses your Tag Library to see the effects of your code changes.
IMPORTANT: due to an issue with the 2.1.0 version of the maven-sling-plugin, you must ensure that the JCR path that you want to deploy the services and the taglib bundles to already exists before you make use of the auto-deploy profile. Check the pom.xml in either module for further information.
Use this module to build and package your entire CQ Project into a single deployable CQ Package - the package will include everything from the view, config, services and taglib modules.
Normally as a developer you will not use this module during day-to-day local development. This module will mainly be used for making nice / clean / repeatable releases from the Development team to the QA team, or for Staging and Production environments for example.
Use this module for sharing content between developers for early stage testing purposes.
Most CQ development projects must begin and proceed for a significant amount of time before content authors begin to formally contribute real content through a CQ Author instance. However, since CQ is very content centric, developers often need content to be available to fully test their code.
The intent of this module is to allow developers to easily share content (via a source code repository) and prevent 2 situations:
IMPORTANT: Do not confuse this module with the view module. The view module will contain code and assets that are appropriate for the development team to create and manage during all phases of the project (including after "go live"). This module instead contains content that will eventually be managed by content authors and will only temporarily be managed by developers. The filter.xml file to control how vlt works in the view module and in the content module are configured differently to reflect this difference. Once the content authors have access to a functional CQ Author instance and are able to contribute real content and use the other management features available to them, this module should be deleted (removed from the Maven build and also removed from your source code repository) - and instead developers should start using CQ Packages exported from the CQ Author environment that contain the real content and use that real content for any further testing purposes going forward.
This module is not bundled into the CQ Package created by the all module, as it is not intended to be included in formal releases from the Development team.
Need help with your Adobe CQ 5.4 and 5.5 implementation? We're here to help. Contact us at info@headwire.com
Jumpstart your CQ project - consider the twitter bootstrap implementation with CQ providing a wysiwyg template editor and base components for an every day website.