Objective:
Archetypes create a minimal AEM project setup which works as a starting point for any new AEM application. So when setting up codebase for your new project, DO NOT COPY it from your old codebase. Instead, the code base should be setup using latest archetype. Using archetype is very easy thing and it just need to run a single command. Even if you are migrating old code bases to new AEM version, start from creating a new code base based on recommended archetype (Refer table below) and then copy individual pieces of old code base to appropriate location as per new archetype structure.This article talks about maven archetypes. If you are looking for Lazybones, refer this link: https://helpx.adobe.com/experience-manager/using/aem_lazybones.html
Solution:
Based on your AEM version, choose the desired project archetype from the below table:
Archetype Version | AEM Version |
---|---|
7 | 6.0 or newer |
8 | 6.0 or newer |
9 | 6.0 or newer |
10 | 6.0 or newer |
11 | 6.2 or newer |
12 | 6.3 or newer |
13 | 6.4, 6.3 + SP2 |
14 | 6.4, 6.3 + SP2 |
15 | 6.4, 6.3 + SP2 |
16 | 6.4, 6.3 + SP2 |
17 | 6.4, 6.3 + SP2 |
18 | 6.5, 6.4, 6.3 + SP3 |
19 | 6.5, 6.4, 6.3 + SP3 |
20 | 6.5, 6.4, 6.3 + SP3 |
Follow these steps to generate standard project structure:
- Go to the project code folder
- Open command prompt
- Run the below command:
mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=18 -DarchetypeCatalog=https://repo.adobe.com/nexus/content/groups/public/ORmvn archetype:generate -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=20
*Change the "DarchetypeVersion" parameter depending on AEM version. Refer table above. - When prompt enter additional details about groupId, artifactId etc.
References:
1. https://helpx.adobe.com/experience-manager/using/maven_arch13.html
2. https://github.com/adobe/aem-project-archetype
3. https://github.com/adobe/aem-project-archetype/blob/master/VERSIONS.md
No comments:
Post a Comment