
Learn how AEM packages are built, what's inside the ZIP files, how Maven modules and OSGi bundles fit together, and how deployment differs between AEM 6.5 and AEM as a Cloud Service.
If you've spent any amount of time developing in Adobe Experience Manager, you've probably come across Package Manager. Maybe you've downloaded a package, then had to install one on your local, or maybe just stared at a bunch of ZIP files wondering what exactly these are for and where they come from.
There are quite a few moving pieces here, and it's easy to mix them up. Between Maven modules, OSGi bundles, content packages, and Adobe's Cloud Manager pipelines, there's a lot more happening than simply throwing everything into a ZIP file.
So, let's break it down.
In AEM, a content package is essentially a ZIP file containing serialized repository content and metadata that tells AEM how that content should be imported.
You can inspect and manage packages through Package Manager, typically available on your local at:
http://localhost:4502/crx/packmgr/
Packages can contain things like component definitions, HTL scripts, client libraries, editable templates, configurations, and repository content. But here's where things get a little confusing.
A content package is not the same thing as an OSGi bundle.
An OSGi bundle is a JAR file containing compiled Java classes and metadata that allow AEM's OSGi framework to manage and run it. A content package, on the other hand, is a ZIP file used to move repository content into AEM. It can also contain an OSGi bundle as an embedded artifact.
And then we have the all package, which pulls the deployable pieces of our application together.
Think of them this way:
.jar): Your compiled Java application code.
.zip): Repository content and configuration that need to be installed into AEM.
all.zip): A package containing the other packages and bundles needed to deploy your application.
core/Good ‘ol Java. I don’t know about you, but (..I’m probably revealing my age here) a lot of my college coursework was done in Java. So when I moved into the AEM scene, everything was fairly familiar to me. I’m old, so that may no longer be the case for upcoming developers. You’ll have to let me know on that one. ;)
Anyway, in a typical AEM project generated from Adobe's Maven archetype, core/ is where your application's Java code lives.
This includes things like:
Your HTL script (server-side HTML templating) can then use those methods to render the component.
The important distinction is that the Sling Model doesn't define your component's actual repository structure or HTML markup. Those responsibilities belong to the component definition and rendering scripts. I'll get into Sling Models in more detail another time. For now, we're just concerned with where they live and how they get packaged.
In a typical project, you'll find them somewhere under:
core/
└── src/
└── main/
└── java/
└── com/
└── example/
└── aem/
└── core/
└── models/
└── ExampleModel.java
The package structure depends on your project, but the concept stays the same.
You may encounter different layouts in older AEM projects. That's not necessarily wrong; AEM has been around for quite some time, and the archetypes have evolved considerably. So don’t just assume every older directory called packages/ serves the same purpose as today's core/ module.
When Maven builds the core module, the Java source is compiled and packaged into a JAR. The JAR also contains an OSGi manifest describing information such as the bundle's symbolic name, version, and imported or exported Java packages.
Depending on how your project is configured, you may see a bnd.bnd file. This file can provide instructions to the Bnd tooling used to generate OSGi bundle metadata. However, not every project needs a separate bnd.bnd file. Some configurations are defined through Maven plugins instead.
The important part is the generated OSGi metadata, not whether a particular configuration file exists. The resulting artifact might look something like:
your-site.core-1.0.0-SNAPSHOT.jar
That JAR is what ultimately provides the Java functionality running inside AEM.
ui.apps/ & ui.frontend/Now for my favorite part of the project. That is, the part that makes everything look pretty.
If you've worked on the front end of an AEM project, you've probably spent plenty of time in ui.apps. Depending on your project's setup, you may also have a dedicated ui.frontend module.
These two modules work together, but they're not interchangeable.
ui.frontend/This is where you'll typically find your front-end source code and build tooling. Things like JavaScript, TypeScript, Sass, CSS, and Webpack configurations can live here. When the front-end build runs, those source files get processed into browser-ready assets. In the standard full-stack clientlib workflow, the build then generates AEM client libraries using tooling such as aem-clientlib-generator.
Here's the important part: ui.frontend doesn't normally produce its own deployable AEM content package. Instead, its generated clientlibs become part of the application's deployed front-end assets, typically through ui.apps. That's an important distinction when you're trying to figure out why you don't see a ui.frontend.zip sitting in Package Manager.
ui.apps/This is where a lot of the actual AEM component structure lives.
You'll typically find:
/apps
ui.apps/
└── src/
└── main/
└── content/
└── jcr_root/
└── apps/
└── your-site/
├── components/
│ └── content/
│ └── hero/
│ ├── .content.xml
│ └── hero.html
└── clientlibs/
Maven packages this repository structure into a content package that can be deployed to AEM.
So, while ui.frontend is generally responsible for compiling your front-end source, ui.apps contains the AEM application resources that reference or deliver those assets.
There are other front-end deployment options in AEM as a Cloud Service, including front-end pipelines, but we're focusing on the traditional full-stack clientlib approach here.
ui.content/ and ui.config/?We've covered Java and front-end code, but there are still a couple of important modules to discuss.
ui.content/The ui.content module contains repository content and configurations outside the application-code areas.
Depending on the project, that might include:
/conf
/content
ui.config/The ui.config module contains OSGi configuration resources for your application.
These configurations are typically stored beneath /apps and organized according to their intended run modes. For example, an application may need different configuration values depending on whether it is running on Author or Publish. Keeping these configurations in source control also makes deployments more predictable.
In AEM as a Cloud Service, OSGi configuration changes belong in the deployment pipeline rather than being manually maintained on running instances.
filter.xmlNow that we understand the modules, how does AEM know which repository paths belong to a particular package?
This is where filter.xml comes into play.
A content package uses a FileVault workspace filter to define the repository paths it manages. For example, the ui.apps module might contain a filter similar to this:
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<filter root="/apps/your-site"/>
</workspaceFilter>
This tells FileVault that the package manages content beneath /apps/your-site.
You can also define more specific roots, include and exclude rules, and import modes, depending on what you're packaging. The distinction here is that filter.xml defines the repository scope of the package. It does not define the entire Maven build process. That's the job of the Maven POM files and build plugins.
One thing worth mentioning: don't blindly add repository paths to your filters.
An overly broad filter or an incorrect import mode can overwrite or remove repository content during installation. For content authors, that could be a pretty bad day.
pom.xmlYou've probably noticed that AEM projects contain several pom.xml files. There's usually one at the root of the project, along with additional POM files inside individual modules. These files tell Maven how to build the project.
The root POM typically defines shared configuration and declares the project modules. Individual module POM files control things such as:
core module produces an OSGi-compatible JAR, while ui.apps and ui.content produce FileVault content packages. The all module then brings the deployable artifacts together.
When you run:
mvn clean install
Maven builds the configured modules, runs applicable validation and tests, and produces their artifacts. You'll typically find the resulting JAR and ZIP files in the corresponding module's target/ directory.
Keep in mind that mvn clean install is a Maven build command. It doesn't automatically mean the packages have been installed into your running AEM instance. Some AEM projects provide additional Maven profiles for local installation, such as autoInstallSinglePackage. That's a separate step from simply creating the artifacts.
Third-party AEM application packages should be embedded in the appropriate container location, typically under a path such as:
jcr_root/
└── apps/
└── your-site-packages/
└── container/
└── install/
└── vendor-app.all.zip
This is a simplified example of an
allpackage. The exact structure depends on your Maven configuration, and additional third-party applications may be embedded as container packages.
For a local and 6.5 on-prem AEM instance, the process generally looks like this:
Source Code
↓
Maven Build
↓
JARs and Content Packages
↓
all.zip
↓
Local Package Installation
↓
AEM Repository and OSGi Runtime
You can inspect the resulting content packages through Package Manager and verify that the expected resources and bundles have been installed.
Now here's where things work a little differently.
In AEM as a Cloud Service, application code isn't deployed by manually uploading ZIP files through Package Manager. Instead, your code goes through a Cloud Manager pipeline.
Cloud Manager builds and validates the application, then handles deploying the code and content. Behind the scenes, application code is converted into a deployment artifact based on Apache Sling Feature Models, while mutable repository content is handled separately. This separation matters because areas like /apps are immutable in Cloud Service. You can't simply change application code on a running Cloud instance the way you might on a local AEM server.
Package Manager still exists, and you can use it for permitted content transfers. Just don't confuse that with deploying application code. That's Cloud Manager's job.
If you take anything away from this, it's that Maven, FileVault, OSGi, Package Manager, and Cloud Manager all play different roles.
Maven builds the application. FileVault packages repository content. OSGi runs your Java bundles. Package Manager lets you manage supported repository packages. And Cloud Manager handles the deployment of application code to AEM as a Cloud Service.
Once you understand how these pieces fit together, those ZIP files can start to make a lot more sense and managing them becomes much easier. Then the next time something ends up in the wrong place—or doesn't show up at all—you'll have a much better idea of where to start looking.
AEM developer and frontend specialist with expertise in Adobe Experience Manager, React, and modern web development. Passionate about creating accessible, performant web experiences.
Comments
0 comments
Join the discussion
No comments yet. Have a question or something to add?