April 7, 2020
Estimated Post Reading Time ~

Maven Archetype for CQ multi-module maven project

multimodule-content-package-archetype plugin usage example:

[code language=”java”]
mvn archetype:generate -DarchetypeRepository=http://repo.adobe.com/nexus/content/groups/public/ -DarchetypeGroupId=com.day.jcr.vault
-DarchetypeArtifactId=multimodule-content-package-archetype -DarchetypeVersion=1.0.2 -DgroupId=com.company.project.cqcommons -DartifactId=cqcommons -Dversion=1.0-SNAPSHOT -Dpackage=com.company.project.cqcommons -DappsFolderName=project -DartifactName=cqcommons -DcqVersion=5.6.1 -DpackageGroup=company
[/code]

Using multimodule-content-package-archetype creates the following folder structure

[code]
/bundle //holds the osgi bundle java src
..
pom.xml
/content //holds the jcr nodes
..
pom.xml
/pom.xml //creates a zip package of osgi bundle and content
[/code]

maven install -PautoInstallPackage: To install the complete package zip
maven install -PautoInstallBundle: To install subsequent OSGi bundles only after java source changes

Refer : http://dev.day.com/docs/en/cq/aem-how-tos/development/how-to-build-aem-projects-using-apache-maven.html


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.