AEM Project Archetype
Start by generating a vanilla project using the AEM Project archetype.
For example:
mvn -B archetype:generate \
-D archetypeGroupId=com.adobe.aem \
-D archetypeArtifactId=aem-project-archetype \
-D archetypeVersion=39 \
-D appTitle="My Asset Share" \
-D appId="my-asset-share" \
-D groupId="com.myassetshare"
Add Asset Share Commons as a dependency
In the <dependencies> section of your project’s parent pom.xml (root of the project) add the following dependencies:
When deploying to AEM as a Cloud Service
<!-- parent pom.xml -->
<dependencies>
...
<dependency>
<groupId>com.adobe.aem.commons</groupId>
<artifactId>assetshare.all</artifactId>
<version>3.11.4</version>
<classifier>cloud</classifier>
<type>zip</type>
</dependency>
<!-- Optional dependency to code against Asset Share Commons APIs -->
<dependency>
<groupId>com.adobe.aem.commons</groupId>
<artifactId>assetshare.core</artifactId>
<version>3.11.4</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.adobe.aem.commons</groupId>
<artifactId>assetshare.core.cloud</artifactId>
<version>3.11.4</version>
<type>jar</type>
</dependency>
...
<dependencies>
When deploying to AEM 6.5.x
<!-- parent pom.xml -->
<dependencies>
...
<dependency>
<groupId>com.adobe.aem.commons</groupId>
<artifactId>assetshare.all</artifactId>
<version>3.11.4</version>
<type>zip</type>
</dependency>
<!-- Optional dependency to code against Asset Share Commons APIs -->
<dependency>
<groupId>com.adobe.aem.commons</groupId>
<artifactId>assetshare.core</artifactId>
<version>3.11.4</version>
<type>jar</type>
</dependency>
...
<dependencies>
Embed Asset Share Commons in All module
Include Asset Share Commons 2.x’s all project as an embedded in your AEM Maven project’s all/pom.xml.
When deploying to AEM as a Cloud Service
-
Add the Asset Share Commons
allproject withcloudclassifier as a<dependency>.<dependencies> ... <dependency> <groupId>com.adobe.aem.commons</groupId> <artifactId>assetshare.all</artifactId> <classifier>cloud</classifier> <!-- MUST ADD FOR AEM AS A CLOUD SERVICE --> <type>zip</type> </dependency> ... </dependency> -
Add the
assetshare.alldependency withcloudclassifier to yourall/pom.xml’s<embeddeds>list as acontainer.<plugins> <plugin> <groupId>org.apache.jackrabbit</groupId> <artifactId>filevault-package-maven-plugin</artifactId> ... <configuration> <allowIndexDefinitions>true</allowIndexDefinitions> ... <embeddeds> <embedded> <groupId>com.adobe.aem.commons</groupId> <artifactId>assetshare.all</artifactId> <classifier>cloud</classifier> <!-- MUST ADD FOR AEM AS A CLOUD SERVICE --> <type>zip</type> <target>/apps/<my-app>-packages/container/install</target> </embedded> ...
When deploying to AEM 6.5.x
-
Add the Asset Share Commons
allproject as<dependency>.<dependencies> ... <dependency> <groupId>com.adobe.aem.commons</groupId> <artifactId>assetshare.all</artifactId> <!-- OMIT CLASSIFIER FOR AEM 6.5 --> <type>zip</type> </dependency> ... </dependency> -
Add the
assetshare.alldependency to yourall/pom.xml’s<embeddeds>list as acontainer.<plugins> <plugin> <groupId>org.apache.jackrabbit</groupId> <artifactId>filevault-package-maven-plugin</artifactId> ... <configuration> <allowIndexDefinitions>true</allowIndexDefinitions> ... <embeddeds> <embedded> <groupId>com.adobe.aem.commons</groupId> <artifactId>assetshare.all</artifactId> <type>zip</type> <target>/apps/<my-app>-packages/container/install</target> </embedded> ...
(Optional) Custom development using Asset Share Commons APIs
- Optionally, include the
assetshare.coreas a dependency in your AEM project’score/pom.xmlif you plan developing Java code against Asset Share Commons’ APIs.
When deploying to AEM as a Cloud Service
```
<dependencies>
...
<dependency>
<groupId>com.adobe.aem.commons</groupId>
<artifactId>assetshare.core</artifactId>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.adobe.aem.commons</groupId>
<artifactId>assetshare.core.cloud</artifactId>
<type>jar</type>
</dependency>
...
</dependency>
```
When deploying to AEM 6.5.x
```
<dependencies>
...
<dependency>
<groupId>com.adobe.aem.commons</groupId>
<artifactId>assetshare.core</artifactId>
<type>jar</type>
</dependency>
...
</dependency>
```
Update Dispatcher module
When generating a project via the archetype a Dispatcher module is created.
-
Update the
filter.anyfile to include the following filters. - Make a copy of the
default.farm, i.easset-share-commons.farmatsrc/conf.dispatcher.d/available_farms/default.farm. - Update the new farm to include the following headers to enable cache-able HTTP request headers)
- Update the symbolic link at
dispatcher/src/conf.dispatcher.d/enabled_farmsto point to the new farm.
Update the Frontend module
Asset Share Commons ships with two themes Light and Dark. These can be used directly. If you would like to customize the theme to match your brand’s colors perform the following steps:
- In your project remove the contents of the directory
ui.frontendexcept for theui.frontend/pom.xmlfile. - Download the contents of either the Light or Dark. It is far easier to start from one of the sample themes.
- Copy the entire contents of the previous step into your project’s
ui.frontendfolder. Do not copy thepom.xmlfile from the Asset Share Commons repo. -
Open the file
ui.frontend/clientlib.config.js. Make the following changes:-
Update the
clientLibRootto match your project:clientLibRoot: "./../ui.apps/src/main/content/jcr_root/apps/<my-app>/clientlibs" - Update the
namefromsemanticui-lighttoclientlib-site. - Update the
categoriesfromasset-share-commons.semantic-ui-lightto<my-app>-asset-share.theme.
-
- Make a change to the file
ui.frontend/semanticui/site/globals/site.variablessuch as updating@primaryColor.
Update sample content
Asset Share Commons includes templates and a series of pages pre-configured. A Light and Dark set of content is included. These can be used as is. For more granular control, copy these templates and pages into your projects ui.content folder and modify to match your projects needs.
- In your project’s
ui.contentmodule remove the folder at:ui.content/src/main/content/jcr_root/conf/<your-app>/settings/wcm. - Replace the
wcmfolder with Asset Share Common’s wcm folder. - If using the Light theme as a base, under
wcm/templatesremove the Dark theme templates ( or vice-versa). - Remove the content under:
ui.content/src/main/content/jcr_root/content/<your-app>/us/enand replace with either the Light set of pages or Dark set. - Perform a find+replace across files, to modify any references to
/conf/asset-share-commons/settings/wcmwith/conf/<your-app>/settings/wcm. There should be 30 references across 30 files to update. - Open the policies file at
ui.content/src/main/content/jcr_root/conf/<your-app>/settings/wcm/policies/.content.xml. - Find and replace any references to
asset-share-commons.semantic-ui-lightand replace with the category used for your custom clientlib from theui.frontendmodule i.e<my-app>-asset-share.theme. There should be 3 references. - Perform a find+replace across files and modify any references to
/content/asset-share-commons/en/lightwith/content/<your-app>/us/en.
Example project
An example project has been created for the WKND Brand:

You can view the source code for the project here.