Add ACS AEM Commons to your AEM Maven project

ACS AEM Commons should be included as a Maven dependency on in your AEM project. The instructions for adding ACS AEM Commons to your project varies by the type of AEM and version of ACS AEM Commons you are using.

Please refer to Compatibility to check which version of ACS AEM Commons is compatible with your version of AEM.

Note that all <dependency> entries listed below can be defined at the reactor pom.xml’s <dependencyManagement> with the version, type and classifier, and the version-less dependencies can be used in the sub-project poms. The instructions below define the dependencies directly in each sub-project pom for clarity and succinctness.

ACS AEM Commons 6.0.0+

In ACS AEM Commons 6.0.0, the main dependency artifact ID was renamed from acs-aem-commons-content to acs-aem-commons-all.

The setup for embedding/depending on ACS AEM Commons in your code base differs slightly between AEMaaCS and AEM 6.5.

AEM as a Cloud Service

Your Container Content Package (usually called all/pom.xml )

In your container content package module’s pom.xml file you extend both the

like this:

<plugins>
  <plugin>
    <groupId>org.apache.jackrabbit</groupId>
    <artifactId>filevault-package-maven-plugin</artifactId>
      ...
      <configuration>
        <embeddeds>
          <embedded>
            <!-- the artifact with the given id from the project dependencies is embedded -->
            <artifactId>acs-aem-commons-all</artifactId>
            <target>/apps/my-app-vendor-packages/container/install</target>
            <filter>true</filter>
            <isAllVersionsFilter>true</isAllVersionsFilter>
          </embedded>
        ...
        </embeddeds>
      ...
      </configuration>
    ...
  </plugin>
</plugins>
...
<dependencies>
  <dependency>
    <groupId>com.adobe.acs</groupId>
    <artifactId>acs-aem-commons-all</artifactId>
    <classifier>cloud</classifier>
    <version>6.10.0</version>
    <type>zip</type>
  </dependency>
  ...
</dependencies>

Your OSGi Bundle(s) (usually called core) (Optional)

To use Java APIs provided by ACS AEM Commons in your code, add a dependency on the acs-aem-commons-bundle in your OSGi bundle Maven project.

<dependency>
    <groupId>com.adobe.acs</groupId>
    <artifactId>acs-aem-commons-bundle</artifactId>
    <version>6.10.0</version>
    <scope>provided</scope>
</dependency>

AEM 6.5

All information of AEM as a Cloud Service above applies, but instead of using the specific classifier cloud, you don’t use any classifier at all. Also instead of embeddeds one leverages subpackages

Your Container Content Package (usually called all)

In your container content package module’s pom.xml file, add this:

<plugins>
  <plugin>
    <groupId>org.apache.jackrabbit</groupId>
    <artifactId>filevault-package-maven-plugin</artifactId>
      ...
      <configuration>
        <subpackages>
          <subpackage>
            <!-- the artifact with the given id from the project dependencies is embedded -->
            <artifactId>acs-aem-commons-all</artifactId>
            <filter>true</filter>
            <isAllVersionsFilter>true</isAllVersionsFilter>
          </subpackage>
        ...
        </subpackages>
      ...
      </configuration>
    ...
  </plugin>
</plugins>
...
<dependencies>
  <dependency>
    <groupId>com.adobe.acs</groupId>
    <artifactId>acs-aem-commons-all</artifactId>
    <version>6.10.0</version>
    <type>zip</type>
  </dependency>
  ...
</dependencies>

Your OSGi Bundle(s) (usually called core) (Optional)

In your OSGi bundle module’s pom.xml file, add this:.

<dependency>
    <groupId>com.adobe.acs</groupId>
    <artifactId>acs-aem-commons-bundle</artifactId>
    <version>6.10.0</version>
    <scope>provided</scope>
</dependency>

ACS AEM Commons < 6.0.0

Prior to ACS AEM Commons 6.0.0, the main dependency artifact ID was named acs-aem-commons-content.

Your all/pom.xml

In the filevault-package-maven-plugin plugin configuration of your all project’s pom.xml file, add this:

<plugins>
    <plugin>
        <groupId>org.apache.jackrabbit</groupId>
        <artifactId>filevault-package-maven-plugin</artifactId>
        ...
        <configuration>
            <embeddeds>
                ...
                <embedded>
                    <artifactId>acs-aem-commons-all</artifactId>
                    <target>/apps/my-app-vendor-packages/container/install</target>
                    <filter>true</filter>
                    <isAllVersionsFilter>true</isAllVersionsFilter>
                </embedded>
                ...

In the <dependencies> section of your all (container-package) project’s pom.xml file, add this:

<dependency>
    <groupId>com.adobe.acs</groupId>
    <artifactId>acs-aem-commons-content</artifactId>
    <version>5.7.0</version>
    <classifier>min</classifier>
    <type>zip</type>
</dependency>

Your core/pom.xml (Optional)

To use Java APIs provided by ACS AEM Commons in your code, add a dependency on on the acs-aem-commons-bundle in your OSGi bundle Maven project.

<dependency>
    <groupId>com.adobe.acs</groupId>
    <artifactId>acs-aem-commons-bundle</artifactId>
    <version>5.7.0</version>
    <scope>provided</scope>
</dependency>