AEM 6.5 - Using ACS AEM Commons as a dependency

aaykay22

19-08-2020

I have been following the documentation on https://adobe-consulting-services.github.io/acs-aem-commons/pages/maven.html

We are upgrading AEM from 6.3.3.7 to 6.5.5. The acs-aem-commons package works sweet in AEM 6.3 through code POM dependencies and we are using shared component properties as an example. 

I have used Archetype 23 to migrate code to new structure however I am not planning on using ui.content package as I have pretty much all I need in /core, /ui.apps, /ui.frontend(.react) project.

Am I supposed to be using ui.content package just to include acs aem commons dependency in the project or I am missing something here?

 

Is there any other way I can include ACS AEM Commons in my AEM 6.5 project? I really want to avoid manually installing the package on my author/publisher. 

Accepted Solutions (1)

Accepted Solutions (1)

aaykay22

19-08-2020

Thanks you guys for your help!
I have figured out what the issue was, the documentation here is missing some details for on-premise AEM solutions -

I am using archetype 23 that is used for both AEM as a cloud service and on-premise AEM 6.5. The documentation is only referring to the updates for the cloud service.


This is how I got it fixed for ui.apps project and got the ACS AEM Commons bundle was available - 

ui.apps/pom.xml
Add a dependency for the acs aem commons content package -

 

<dependency>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-content</artifactId>
<version>${com.adobe.acs.acs-aem-commons.version}</version>
<type>content-package</type>
<classifier>min</classifier> <!-- optional, 'full' only includes Twitter integration (with 3rd party dependency on twitter4j) -->
</dependency>

 Add ACS AEM Commons package as Embed dependency for filevault-package-maven-plugin -

<embedded>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-content</artifactId>
<target>/apps/<my-project-name>/install</target>
</embedded>

 

Answers (4)

Answers (4)

ChitraMadan

MVP

19-08-2020

Hi @aaykay22 ,

 

You can add the acs-aem-commons dependency in your parent pom.xml and in core/pom.xml

 

/pom.xml

<dependency>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-bundle</artifactId>
<version>3.19.0</version>
<scope>provided</scope>
</dependency>
 
core/pom.xml
<dependency>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-bundle</artifactId>
</dependency>

talk0501

15-09-2020

Adding ACS Commons in the AEM project as Maven build works as is by following the steps in https://adobe-consulting-services.github.io/acs-aem-commons/pages/maven.html
As described in this document, for archetype 21 and above its recommended to use "all" project module to embed ACS commons in the project.
Its just that we need to replace the 

<target>/apps/my-app-packages/application/install</target>

<target>
/apps/my-app-packages/content/install</target>

 with your package name as 

<target>/apps/<<package-name>>/content/install</target>
<target>/apps/<<package-name>>/application/install</target> 

Theo_Pendle

MVP

19-08-2020

Hi @aaykay22,

The ACS Commons installation page you linked to contains the two steps you you need:

  1. Fetch the acs-aem-commons-content artifact via a maven dependency
  2. Embed that artifact into a package which you will then deploy

The documentation mentions "your content project’s pom.xml" but this is just a recommendation, there is no technical reason why this won't work in ui.apps, so you can just follow the documentation as-is and simply apply it to your ui.apps project 🙂

Disclaimer: if you have multiple AEM sites (tenants) running on a single instance, you may want to completely move the embedding of ACS Commons (and any other customization of the AEM platform) into a separate project. Check the architecture diagram in this tutorial: https://levelup.gitconnected.com/aem-multitenancy-running-multiple-websites-on-a-single-aem-environm... There are explanations too.