> For AI agents: the complete documentation index is available at https://nhanbe.id.vn/llms.txt, the full documentation bundle is available at https://nhanbe.id.vn/llms-full.txt.

# Introduction to AEM

## What is AEM?

Adobe Experience Manager (AEM) is a content management system (CMS) built on Java. It manages websites, digital assets, and content across channels.

| Layer               | What it does                                                     |
| ------------------- | ---------------------------------------------------------------- |
| AEM                 | CMS features — authoring UI, templates, workflows, assets, sites |
| Apache Sling        | Web framework — maps URLs to content, handles HTTP requests      |
| JCR                 | Content storage — a hierarchical, versioned content database     |
| OSGi (Apache Felix) | Module system — manages Java bundles, services, configuration    |
| JVM                 | Runtime — everything runs on the JVM                             |

## Types of AEM

| Variant                   | Description                                                     |
| ------------------------- | --------------------------------------------------------------- |
| AEM as a Cloud Service    | Cloud-native, managed by Adobe, auto-scaling, always up-to-date |
| AEM 6.5 (Managed Service) | Adobe-hosted but customer-managed; manual updates               |
| AEM 6.5 (On-premise)      | Self-hosted on your own infrastructure.                         |

### Key points of AEM as a Cloud Service

- **No CRXDE Lite in production** — content changes go through Git and Cloud Manager.
- **Immutable infrastructure** — runtime cannot be modified at deploy time.
- **Auto-updates** — Adobe continuously deploys updates.
- **Cloud Manager** — CI/CD pipeline for deployment.
- **Rapid Development Environment (RDE)** — fast development environment.

## Author vs Publish

- **Author**: content editing, authoring UI, workflows.
- **Publish**: content delivery, public-facing website.

## Project Structure Walkthrough

```tree
mysite/
├── pom.xml                    # Parent POM (reactor)
├── all/                       # Aggregates all packages for deployment
│   └── pom.xml
├── core/                      # Java code (Sling Models, services, servlets)
│   ├── pom.xml
│   └── src/main/java/
│       └── com/mysite/core/
├── ui.apps/                   # AEM components, templates, configs (JCR content)
│   ├── pom.xml
│   └── src/main/content/
│       └── jcr_root/
│           └── apps/mysite/
│               ├── components/
│               ├── clientlibs/
│               └── …
├── ui.content/                # Sample content and pages
│   ├── pom.xml
│   └── src/main/content/
│       └── jcr_root/
│           └── content/mysite/
├── ui.config/                 # OSGi configurations
│   ├── pom.xml
│   └── src/main/content/
│       └── jcr_root/
│           └── apps/mysite/osgiconfig/
├── ui.frontend/               # Frontend build (webpack/clientlibs source)
│   ├── package.json
│   └── src/
├── dispatcher/                # Dispatcher configuration
│   └── src/
│       ├── conf.d/
│       └── conf.dispatcher.d/
└── it.tests/                  # Integration tests
    └── pom.xml
```

## Module Responsibilities

| Module          | Contains                                                    | Deployed as           |
| --------------- | ----------------------------------------------------------- | --------------------- |
| **core**        | Java code — Sling Models, OSGi services, servlets           | OSGi bundle (JAR)     |
| **ui.apps**     | AEM components, HTL templates, clientlibs, configs          | Content package       |
| **ui.content**  | Sample pages, DAM assets, content structures                | Content package       |
| **ui.config**   | OSGi configurations per run mode                            | Content package       |
| **ui.frontend** | Frontend source (SCSS, JS) — compiled and copied to ui.apps | Not deployed directly |
| **all**         | Aggregates all packages into one deployable unit            | Container package     |
| **dispatcher**  | Apache/Dispatcher configuration                             | Deployed separately   |
| **it.tests**    | Integration tests                                           | Run during build      |

## Content Package Filters

Filters control what gets deployed (both installed and removed). When using `mode="replace"`, content at that path is deleted and replaced on install.

Command:

```
mvn clean install -PautoInstallSinglePackage
```

This command:

1. Compiles all Java in `core`.
2. Builds the frontend in `ui.frontend/`.
3. Packages everything into a content package.
4. Deploys the `all` package to `http://localhost:4502`.

- `autoInstallSinglePackagePublish` deploys to publish (4503).
