AEM as a Cloud Service supports the deployment of the
ui.apps component scripts as precompiled bundled scripts. This allows developers to precompile their scripts at build-time and package them as OSGi bundles.
Deploying your scripts as precompiled bundled scripts has the following benefits:
sling:resourceSuperType) and delegation to other resource types (via HTL’s
data-sly-resourceblock element or via the
sling:includeJSP tag, for example) can be mapped via the bundle’s meta-data
htl-maven-plugin can validate the syntax of HTL scripts, but it can also be used to transpile the HTL scripts into Java classes. These are then added to your Maven project’s
generated-sources folder and picked-up by the
bnd-maven-plugin can be added to generate the OSGi bundle’s metadata for Java API imports.
The OSGi framework provides a powerful way of defining Requirements and Capabilities to express contracts between various components. These are described via meta-data and enforced at runtime. Bundled scripts use this mechanism to express both their inheritance relationships (
sling:resourceSuperType), as well as delegation (including other resource types in the rendering process).
Starting with version 31, the AEM Project Archetype can be used to correctly set up an AEM as a Cloud Service project to use precompiled bundled scripts. In addition, the AEM Project Archetype configures the AEM as a Cloud Service SDK Build Analyzer Maven Plugin to validate the Java package-level as well as script-level dependencies.