# adobe/aem-project-archetype architecture

> Architecture diagram of the GitHub repository adobe/aem-project-archetype, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adobe/aem-project-archetype
- Repository: https://github.com/adobe/aem-project-archetype

## Overview

#### Purpose and Entry Point
This repository packages the **AEM Project Archetype**, a Maven archetype that generates configurable, multi-module Adobe Experience Manager projects rather than running an application itself. Generation begins through Maven Archetype Plugin metadata and is parameterized by properties such as AEM version, frontend type, Commerce, Forms, and Dispatcher inclusion.
- `pom.xml`
- `src/main/resources/META-INF/maven/archetype-metadata.xml`
- `src/main/archetype/archetype.properties`

#### Archetype Assembly and Lifecycle
The archetype’s source project is a template tree under `src/main/archetype`; Maven packages it as an archetype. Groovy hooks execute around packaging/generation to conditionally include modules, normalize generated files, and apply options. The generated root reactor then builds and deploys its selected AEM packages and frontend artifacts.
- `src/main/archetype/pom.xml`
- `src/main/resources/META-INF/archetype-pre-package.groovy`
- `src/main/resources/META-INF/archetype-post-generate.groovy`

#### Generated AEM Backend
The `core` module is the generated Java/OSGi bundle. It supplies example Sling-facing extension points—models, servlets, request filters, resource listeners, and scheduled jobs—which establish where project-specific server behavior belongs. AEM/Sling invokes these components; they operate against AEM’s JCR-backed content repository and HTTP request pipeline.
- `src/main/archetype/core/pom.xml`
- `src/main/archetype/core/src/main/java/core/models/HelloWorldModel.java`
- `src/main/archetype/core/src/main/java/core/servlets/SimpleServlet.java`

#### AEM Content Packages and Authoring Boundary
The generated project separates deployable application definitions, OSGi configuration, and mutable site content. `ui.apps` installs `/apps` components, HTL rendering scripts, client library declarations, and optional Commerce/Forms component overlays. `ui.config` supplies runmode-specific OSGi settings. `ui.content` seeds `/conf`, `/content`, DAM assets, editable templates, policies, language masters, and experience fragments—author-managed data after installation.
- `src/main/archetype/ui.apps/src/main/content/jcr_root/apps/__appId__/components/page/body.html`
- `src/main/archetype/ui.config/src/main/content/jcr_root/apps/__appId__/osgiconfig/config`
- `src/main/archetype/ui.content/src/main/content/jcr_root/conf/__appId__/settings/wcm/templates`

#### Frontend Delivery Variants
The archetype can generate conventional Webpack-built client libraries, React or Angular SPA Editor applications, a decoupled frontend, and React Adaptive Forms. Conventional assets compile to AEM clientlibs consumed by server-rendered pages. SPA variants use AEM model clients and component mappings to render AEM-authored content in browser applications; optional SSR adds Node/Express or Adobe I/O-style server entry points.
- `src/main/archetype/ui.frontend.general/src/main/webpack/site/main.ts`
- `src/main/archetype/ui.frontend.react/src/index.js`
- `src/main/archetype/ui.frontend.angular/src/main.ts`

#### Edge, Integrations, and Deployment
Dispatcher templates provide the Apache HTTPD/AEM Dispatcher boundary: virtual hosts and rewrites receive traffic; Dispatcher farms apply request filters, select AEM author/publish renders, and enforce cache/invalidation policy. Cloud and AMS/on-premise layouts are distinct. Optional CIF configuration connects Commerce components to a GraphQL endpoint; Forms content includes Salesforce and Microsoft Dynamics 365 cloud-configuration/data-model scaffolding.
- `src/main/archetype/dispatcher.cloud/src/conf.dispatcher.d/available_farms/default.farm`
- `src/main/archetype/dispatcher.ams/src/conf.d/available_vhosts/__appId___publish.vhost`
- `src/main/archetype/ui.config/src/main/content/jcr_root/apps/__appId__/osgiconfig/config/com.adobe.cq.commerce.graphql.client.impl.GraphqlClientImpl~default.cfg.json`

#### Aggregate Delivery
The generated `all` package is the primary installable aggregate, assembling selected OSGi bundles and content packages for AEM. Optional integration and UI-test modules exercise deployed AEM endpoints and browser flows; repository CI runs Maven validation, release/deploy, and Dispatcher SDK updates.
- `src/main/archetype/all/pom.xml`
- `src/main/archetype/it.tests/src/main/java/it/tests/CreatePageIT.java`
- `.github/workflows/maven-test.yml`

Main entry points: [`src/main/archetype/all/pom.xml`](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/all/pom.xml) (All aggregate package), [`src/main/archetype/pom.xml`](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/pom.xml) (Template reactor), [`src/main/archetype/core/pom.xml`](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/core/pom.xml) (Core OSGi bundle), [`pom.xml`](https://github.com/adobe/aem-project-archetype/blob/develop/pom.xml) (Archetype Maven build)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_archetype["Archetype build"]
  node_root_pom["Archetype Maven build<br/>Maven project<br/>[pom.xml]"]
  node_metadata["Archetype metadata<br/>Maven metadata"]
  node_properties["Generation properties<br/>Archetype properties"]
  node_template_root["Template reactor<br/>Maven template<br/>[pom.xml]"]
  node_pre_hook["Pre-package hook<br/>Groovy hook"]
  node_post_hook["Post-generate hook<br/>Groovy hook"]
end

subgraph group_generated["Generated AEM project"]
  node_all["All aggregate package<br/>AEM package<br/>[pom.xml]"]
  node_core{{"Core OSGi bundle<br/>Java / OSGi<br/>[pom.xml]"}}
  node_sling_model["Sling model example<br/>Java model"]
  node_servlet["Sling servlet example<br/>Java servlet<br/>[SimpleServlet.java]"]
  node_ui_apps["Application package<br/>AEM content package<br/>[body.html]"]
  node_ui_config["OSGi configuration<br/>AEM config package<br/>[config]"]
  node_ui_content["Seeded site content<br/>AEM content package<br/>[templates]"]
  node_aem[("AEM runtime<br/>AEM / Sling")]
  node_frontend["Frontend variants<br/>Webpack / SPA template<br/>[main.ts]"]
end

subgraph group_delivery["Delivery and integrations"]
  node_dispatcher{{"Dispatcher edge<br/>Apache / Dispatcher<br/>[default.farm]"}}
  node_commerce["Commerce GraphQL config<br/>Optional integration"]
  node_integration_tests["Deployed integration tests<br/>AEM integration tests<br/>[CreatePageIT.java]"]
  node_ci["Repository CI<br/>GitHub Actions<br/>[maven-test.yml]"]
end

node_root_pom -->|"reads"| node_metadata
node_root_pom -->|"runs"| node_pre_hook
node_metadata -->|"parameterizes"| node_properties
node_properties -->|"selects modules"| node_template_root
node_pre_hook -->|"assembles"| node_template_root
node_template_root -->|"generates then runs"| node_post_hook
node_template_root -->|"includes"| node_all
node_all -->|"assembles"| node_core
node_all -->|"assembles"| node_ui_apps
node_all -->|"assembles"| node_ui_config
node_all -->|"assembles"| node_ui_content
node_all -->|"installs to"| node_aem
node_core -->|"contains"| node_sling_model
node_core -->|"contains"| node_servlet
node_aem -->|"invokes"| node_core
node_aem -->|"renders components from"| node_ui_apps
node_aem -->|"serves and authors"| node_ui_content
node_frontend -.->|"delivers clientlibs to"| node_ui_apps
node_dispatcher -->|"filters and routes to"| node_aem
node_ui_config -.->|"optionally configures"| node_commerce
node_integration_tests -.->|"tests deployed"| node_aem
node_ci -->|"validates"| node_root_pom
node_ci -.->|"runs"| node_integration_tests

click node_root_pom "https://github.com/adobe/aem-project-archetype/blob/develop/pom.xml"
click node_metadata "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/resources/META-INF/maven/archetype-metadata.xml"
click node_properties "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/archetype.properties"
click node_template_root "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/pom.xml"
click node_pre_hook "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/resources/META-INF/archetype-pre-package.groovy"
click node_post_hook "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/resources/META-INF/archetype-post-generate.groovy"
click node_all "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/all/pom.xml"
click node_core "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/core/pom.xml"
click node_sling_model "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/core/src/main/java/core/models/HelloWorldModel.java"
click node_servlet "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/core/src/main/java/core/servlets/SimpleServlet.java"
click node_ui_apps "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/ui.apps/src/main/content/jcr_root/apps/__appId__/components/page/body.html"
click node_ui_config "https://github.com/adobe/aem-project-archetype/tree/develop/src/main/archetype/ui.config/src/main/content/jcr_root/apps/__appId__/osgiconfig/config"
click node_ui_content "https://github.com/adobe/aem-project-archetype/tree/develop/src/main/archetype/ui.content/src/main/content/jcr_root/conf/__appId__/settings/wcm/templates"
click node_frontend "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/ui.frontend.general/src/main/webpack/site/main.ts"
click node_dispatcher "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/dispatcher.cloud/src/conf.dispatcher.d/available_farms/default.farm"
click node_commerce "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/ui.config/src/main/content/jcr_root/apps/__appId__/osgiconfig/config/com.adobe.cq.commerce.graphql.client.impl.GraphqlClientImpl~default.cfg.json"
click node_integration_tests "https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/it.tests/src/main/java/it/tests/CreatePageIT.java"
click node_ci "https://github.com/adobe/aem-project-archetype/blob/develop/.github/workflows/maven-test.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_root_pom,node_metadata,node_properties,node_template_root,node_pre_hook,node_post_hook toneBlue
class node_all,node_core,node_sling_model,node_servlet,node_ui_apps,node_ui_config,node_ui_content,node_aem,node_frontend toneAmber
class node_dispatcher,node_commerce,node_integration_tests,node_ci toneMint
```

## Components

### Archetype build

Maven metadata, templates, and generation hooks.

- [Archetype Maven build](https://github.com/adobe/aem-project-archetype/blob/develop/pom.xml): Maven project · Packages the template tree as a Maven archetype. · `pom.xml`
- [Archetype metadata](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/resources/META-INF/maven/archetype-metadata.xml): Maven metadata · Defines generated files and required properties. · `src/main/resources/META-INF/maven/archetype-metadata.xml`
- [Generation properties](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/archetype.properties): Archetype properties · Selects AEM version, frontend, and optional features. · `src/main/archetype/archetype.properties`
- [Template reactor](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/pom.xml): Maven template · Root Maven project copied into each generated project. · `src/main/archetype/pom.xml`
- [Pre-package hook](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/resources/META-INF/archetype-pre-package.groovy): Groovy hook · Conditionally assembles the archetype before packaging. · `src/main/resources/META-INF/archetype-pre-package.groovy`
- [Post-generate hook](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/resources/META-INF/archetype-post-generate.groovy): Groovy hook · Normalizes generated files and applies options. · `src/main/resources/META-INF/archetype-post-generate.groovy`

### Generated AEM project

Selected modules emitted by the archetype.

- [All aggregate package](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/all/pom.xml): AEM package · Primary installable aggregate of selected packages and bundles. · `src/main/archetype/all/pom.xml`
- [Core OSGi bundle](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/core/pom.xml): Java / OSGi · Project server extension points for AEM and Sling. · `src/main/archetype/core/pom.xml`
- [Sling model example](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/core/src/main/java/core/models/HelloWorldModel.java): Java model · Example request/content-backed component model. · `src/main/archetype/core/src/main/java/core/models/HelloWorldModel.java`
- [Sling servlet example](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/core/src/main/java/core/servlets/SimpleServlet.java): Java servlet · Example HTTP endpoint extension point. · `src/main/archetype/core/src/main/java/core/servlets/SimpleServlet.java`
- [Application package](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/ui.apps/src/main/content/jcr_root/apps/__appId__/components/page/body.html): AEM content package · Installs /apps components, HTL, and client library definitions. · `src/main/archetype/ui.apps/src/main/content/jcr_root/apps/__appId__/components/page/body.html`
- [OSGi configuration](https://github.com/adobe/aem-project-archetype/tree/develop/src/main/archetype/ui.config/src/main/content/jcr_root/apps/__appId__/osgiconfig/config): AEM config package · Provides runmode-specific settings under /apps. · `src/main/archetype/ui.config/src/main/content/jcr_root/apps/__appId__/osgiconfig/config`
- [Seeded site content](https://github.com/adobe/aem-project-archetype/tree/develop/src/main/archetype/ui.content/src/main/content/jcr_root/conf/__appId__/settings/wcm/templates): AEM content package · Installs templates, policies, and initial authorable content. · `src/main/archetype/ui.content/src/main/content/jcr_root/conf/__appId__/settings/wcm/templates`
- **AEM runtime**: AEM / Sling · Hosts OSGi services, rendering, and JCR-backed content.
- [Frontend variants](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/ui.frontend.general/src/main/webpack/site/main.ts): Webpack / SPA template · Generates clientlibs or React/Angular browser applications. · `src/main/archetype/ui.frontend.general/src/main/webpack/site/main.ts`

### Delivery and integrations

Optional edge, external-service, and validation paths.

- [Dispatcher edge](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/dispatcher.cloud/src/conf.dispatcher.d/available_farms/default.farm): Apache / Dispatcher · Filters, routes, and caches requests before AEM. · `src/main/archetype/dispatcher.cloud/src/conf.dispatcher.d/available_farms/default.farm`
- [Commerce GraphQL config](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/ui.config/src/main/content/jcr_root/apps/__appId__/osgiconfig/config/com.adobe.cq.commerce.graphql.client.impl.GraphqlClientImpl~default.cfg.json): Optional integration · Connects CIF components to a GraphQL endpoint. · `src/main/archetype/ui.config/src/main/content/jcr_root/apps/__appId__/osgiconfig/config/com.adobe.cq.commerce.graphql.client.impl.GraphqlClientImpl~default.cfg.json`
- [Deployed integration tests](https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/it.tests/src/main/java/it/tests/CreatePageIT.java): AEM integration tests · Exercises generated AEM endpoints and flows. · `src/main/archetype/it.tests/src/main/java/it/tests/CreatePageIT.java`
- [Repository CI](https://github.com/adobe/aem-project-archetype/blob/develop/.github/workflows/maven-test.yml): GitHub Actions · Runs Maven validation and delivery checks. · `.github/workflows/maven-test.yml`

## Connections

- Archetype Maven build → Archetype metadata: reads
- Archetype Maven build → Pre-package hook: runs
- Archetype metadata → Generation properties: parameterizes
- Generation properties → Template reactor: selects modules
- Pre-package hook → Template reactor: assembles
- Template reactor → Post-generate hook: generates then runs
- Template reactor → All aggregate package: includes
- All aggregate package → Core OSGi bundle: assembles
- All aggregate package → Application package: assembles
- All aggregate package → OSGi configuration: assembles
- All aggregate package → Seeded site content: assembles
- All aggregate package → AEM runtime: installs to
- Core OSGi bundle → Sling model example: contains
- Core OSGi bundle → Sling servlet example: contains
- AEM runtime → Core OSGi bundle: invokes
- AEM runtime → Application package: renders components from
- AEM runtime → Seeded site content: serves and authors
- Frontend variants → Application package: delivers clientlibs to
- Dispatcher edge → AEM runtime: filters and routes to
- OSGi configuration → Commerce GraphQL config: optionally configures
- Deployed integration tests → AEM runtime: tests deployed
- Repository CI → Archetype Maven build: validates
- Repository CI → Deployed integration tests: runs
