Home - ranjanui/AEM GitHub Wiki

AEM Maven Command

Create New AEM Project Using Maven

//with two folder 1. content, 2. Bundle

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=cq5tutorials  -DartifactId=myCqMavenproject -Dversion=1.0-SNAPSHOT -Dpackage=com.blogspot.cq5tutorials  -DappsFolderName=myCqMavenproject  -DartifactName="my Cq Maven project"   -DcqVersion="5.6.1"  -DpackageGroup="com.blogspot.cq5tutorials"

mvn archetype:generate -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=10 -DarchetypeRepository=https://repo.adobe.com/nexus/content/groups/public/

Resources

Points

  • include global jsp file <%@include file="/libs/foundation/global.jsp" %>

  • Using Properties Object: <%= properties.get("jcr:title") %>

  • Using currentPage Object <%= currentPage.getTitle() %> <%= currentPage.getName() %> <%= currentPage.getPath() %> <%= currentPage.getDepth() %>

  • Using currentNode Object <%= currentNode.getProperty("jcr:title") %> <%= currentNode.getName() %> <%= currentNode.getPath() %> <%= currentNode.getDepth() %>

  • include one jsp in to other: <cq:include script="body.jsp" />

terms

  • OSGI
  • Apache Sling
  • JCR
  • CRX

Syllabus

  1. Getting started

#Files

.content.xml

  • "." start at any name signifies, it is hidden file
  • .content.xml file used by sling framework to understand the nody type definition when it reads data from JCR

xtype

  • An xtype is a symbolic name given to a class.

Query CQ’s JCR with SQL or XPath

  • /crx/explorer/ui/search.jsp

Setup with Eclipse, Maven

  • ref - https://helpx.adobe.com/experience-manager/using/creating-aem-project-using-eclipse.html
  • Install Eclipse
  • Install Maven
  • mvn --version
  • copy the Maven configuration file named settings.xml from [install location]\apache-maven-3.0.4\conf\ to your user profile. For example, C:\Users\scottm.m2\
  • You have to configure your settings.xml file to use Adobe’s public repository. For information, see Adobe Public Maven Repository at http://repo.adobe.com/
  • Create an Experience Manager archetype project by using the Maven archetype plugin
  • Suppose your working directory is C:\AdobeCQ, the maven archetype command is
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.aem.community -DartifactId=echoproject -Dversion=1.0-SNAPSHOT -Dpackage=com.aem.community -DappsFolderName=myproject -DartifactName="My Project" -DcqVersion="5.6.1" -DpackageGroup="My Company"