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+

AEM 6.5

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

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>
                    <groupId>com.adobe.acs</groupId>
                    <artifactId>acs-aem-commons-all</artifactId>
                    <type>zip</type>
                    <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-all</artifactId>
    <version>6.5.0</version>
    <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>6.5.0</version>
    <scope>provided</scope>
</dependency>

AEM as a Cloud Service

All information of AEM 6.5 above applies, but instead of using the acs-aem-commons-all, a specific classifier for cloud is foreseen.

<dependency>
    <groupId>com.adobe.acs</groupId>
    <artifactId>acs-aem-commons-all</artifactId>
    <classifier>cloud</classifier>
</dependency>

ACS AEM Commons < 6.0.0

Prior to ACS AEM Commons 6.0.0, the main dependency artifact ID was named from 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>
                    <groupId>com.adobe.acs</groupId>
                    <artifactId>acs-aem-commons-all</artifactId>
                    <type>zip</type>
                    <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>