March 15, 2020
Estimated Post Reading Time ~

Tutorial on Creating Adobe Experience Manager (AEM) Maven Project Part III

Maven AEM Project Archetype 23 was recently released. To use, set up your local development environment for AEM as a Cloud Service SDK or use one of the following AEM versions: 6.5.0+, 6.4.4.0+ or 6.3.3.4+. Additionally, Java 8 or 11 and Maven 3.3.9+ is also required. Here is an overview of a few of the changes.

Project Generation

The number of prompts for property values when generating the project has been reduced. By default, artifactId will use the appId value and package will use the groupId value. You can change these to use different values if you prefer by adding them to you generate command line.
This is a minimal example for batch mode project generation:
mvn -B archetype:generate \
 -D archetypeGroupId=com.adobe.granite.archetypes \
 -D archetypeArtifactId=aem-project-archetype \
 -D archetypeVersion=23 \
 -D aemVersion=6.5.0 \
 -D appTitle="My Project" \
 -D appId="myproject" \
 -D groupId="com.myproject" \
 -D frontendModule=general \
 -D includeExamples=n

Available Properties

Name
Default
Description
appTitle
For website title and component groups
appId
For app, conf and content folder names; clientlib names
artifactId
${appId}
Base Maven artifact ID
groupId
Base Maven group ID
package
${groupId}
Java Source Package
version
1.0-SNAPSHOT
Project version
aemVersion
6.5.0
Target AEM version (can be cloud for AEM as a Cloud Service; or 6.5.06.4.4, or 6.3.3 for Adobe Managed Services or on-premise)
sdkVersion
latest
When aemVersion=cloud an SDK version can be specified
includeDispatcherConfig
y
Includes a dispatcher configuration either for cloud or for AMS/on-premise, depending of the value of aemVersion (y/n)
frontendModule
none
Includes a Webpack frontend build module that generates the clientlibs (general or noneangular or react for SPA)
languageCountry
en_us
Language and country code to create the content structure from (e.g. en_us)
singleCountry
y
Includes a language-master content structure (y/n)
includeExamples
y
Includes a Component Library example site (y/n)
includeErrorHandler
n
Includes a custom 404 response page that will be global to the entire instance (y/n)

React and Angular Support

The AEM SPA Project Archetype has been merged into this version to facilitate a React or Angular Single Page App that implements the SPA Editor.

Example Content

  • Styling updated for example content
  • Responsivegrid rep*laced with core container component
  • Experience fragment simplified for the header and footer
  • Custom helloworld component updated

Example Content Page

Other Changes Include

  • Support added for AEM as a Cloud Service SDK
  • Mapping / rewrite rules to support the image core component. For example, when using the dispatcher module with the associated Resource Resolver Factory rewrite rule, images referenced in /content/wknd should resolve.
  • org.apache.sling.servlets.annotations dependency management added
  • use Sling’s org.apache.sling.bnd.models.ModelsScannerPlugin which automatically identifies and registers SlingModels in the project.
  • repository-structure project renamed to ui.apps.structure



By aem4beginner

No comments:

Post a Comment

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