Day 10 of 40
Maven Module Anatomy
core, ui.apps, ui.content, ui.config, ui.frontend, all
By the end of today you should be able to
- Name every module the archetype generates and say what belongs in each
- Explain what the 'all' package is and why it embeds the others
- Describe how ui.apps, ui.config and ui.content differ in mutability and purpose
- 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.appsat 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
aemanalyserchecks 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.
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.appsthrough 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:
- Delete the example component folders from
ui.apps. - Delete the example content from
ui.content. - Remove the corresponding entries from each module's
filter.xml. - Remove any example Java classes and their tests from
core. - 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.
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.
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.