AEM in 40 Days
CalendarPhase 2 · Environment & Project Anatomy

Day 10 of 40

Maven Module Anatomy

core, ui.apps, ui.content, ui.config, ui.frontend, all

~45 min read3 videos3 source pages

By the end of today you should be able to

  1. Name every module the archetype generates and say what belongs in each
  2. Explain what the 'all' package is and why it embeds the others
  3. Describe how ui.apps, ui.config and ui.content differ in mutability and purpose
  4. Remove the generated sample content from a project without breaking the build

The modules

An archetype project is a Maven reactor. Each module has one job:

  • core — your Java. OSGi services, Sling Models, servlets, filters, schedulers. Builds an OSGi bundle jar.
  • ui.apps — everything under /apps/<appId>: components, HTL, dialogs, clientlibs, template types. Immutable.
  • ui.config — OSGi configuration, in run-mode folders. Also lands under /apps, so also immutable.
  • ui.content — sample and seed content: /content, /conf (editable templates and policies), tags. Mutable.
  • ui.frontend — a webpack project. Compiles Sass/JS and outputs a clientlib into ui.apps at build time.
  • all — a container package that embeds all the others. This is the single artefact deployed to AEM.
  • dispatcher — Apache and Dispatcher configuration.
  • it.tests — integration tests that run against a real instance.
  • ui.tests — UI tests (Cypress or Selenium, depending on archetype version).
  • analyse — runs Adobe's aemanalyser checks that catch Cloud Service incompatibilities at build time.

The 'all' package

AEM installs content packages, and a project produces several. Rather than installing them individually and hoping the order is right, the all module builds one container package that embeds the rest and declares their install order. Cloud Manager deploys exactly this one artefact.

Inside all/pom.xml you will find <embedded> entries placing each sub-package under /apps/<appId>-packages/{application|content}/install. That split matters:

  • application packages hold immutable content (ui.apps, ui.config, and the core bundle).
  • content packages hold mutable content (ui.content).

Cloud Manager treats them differently: immutable content is deployed with the code in a way that supports rollback, while mutable content is installed once and thereafter belongs to authors.

ui.content is a seed, not a source of truth

Once your site is live, authors own /content. If ui.content keeps overwriting pages on every deploy you will destroy authored work. Its filters should be narrow — typically initial structure and configuration you genuinely want managed in Git, not live pages.

How ui.frontend fits

ui.frontend is an ordinary npm/webpack project. During the Maven build it runs npm run build, and its output is copied into ui.apps as a client library — by convention clientlib-site. Two consequences:

  • Front-end source is versioned as source, not as pre-built minified files.
  • By default the compiled output still ships inside ui.apps through the normal pipeline. Day 23's front-end pipeline changes that.

Cleaning out the samples

If you generated with includeExamples, the project carries a demo component library. Removing it is a documented, mechanical process — do it early, before anything depends on it:

  1. Delete the example component folders from ui.apps.
  2. Delete the example content from ui.content.
  3. Remove the corresponding entries from each module's filter.xml.
  4. Remove any example Java classes and their tests from core.
  5. Rebuild — and if the build passes and the site still renders, you are clean.

Deleting files but leaving filter.xml entries is the usual mistake. A filter pointing at a path the package no longer contains will, on install, remove that path from the repository — which is fine for samples and alarming if you got the path wrong.

Today's takeaway

Java in core, code-side content in ui.apps, config in ui.config, seed content in ui.content, all wrapped by all. Immutable and mutable are packaged separately on purpose.

Watch

Adobe's own videos for this topic. They load only when you press play.

Project Structure
AEM Maven Project Structure
Cleaning an AEM Maven project

Read on Experience League

The primary sources these notes are drawn from.

Your notes

Saved automatically to this browser.

Check yourself

10 questions on today's material. 80% to pass.

Take the quiz