Creating a component in AEM as a Cloud Service without any core or frontend dependency | Community
Skip to main content
Level 4
June 6, 2022
Solved

Creating a component in AEM as a Cloud Service without any core or frontend dependency

  • June 6, 2022
  • 2 replies
  • 912 views

I want to create component in AEM as a Cloud Service without having any dependency of ui.apps on core, ui.frontend or any other module. For example, I want that if any file resides even in core or ui.frontend, I do not have to build those modules before ui.apps. I want that those files to be embeddable in my ui.apps and when I build ui.apps, component should work properly.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kiran_Vedantam

Hi @nikita24tailor,

 

Each and every module in the maven project structure has its own importance. It is not suggested to do everything in a single module.

 

If you still want to have everything under ui.apps you can do it. You can add your java file in the same hierarchy and include the file using data-sly-include.

 

Hope this helps!

 

Thanks,

Kiran Vedantam.

2 replies

Kiran_Vedantam
Community Advisor
Kiran_VedantamCommunity AdvisorAccepted solution
Community Advisor
June 6, 2022

Hi @nikita24tailor,

 

Each and every module in the maven project structure has its own importance. It is not suggested to do everything in a single module.

 

If you still want to have everything under ui.apps you can do it. You can add your java file in the same hierarchy and include the file using data-sly-include.

 

Hope this helps!

 

Thanks,

Kiran Vedantam.

SantoshSai
Community Advisor
Community Advisor
June 6, 2022

Hi @nikita24tailor ,

You can create component in ui.apps and deploy only ui.apps module using following command by switching to apps module

cd .. ui.apps 
mvn clean install -PautoInstallPackage

In this case you do not have to build any other modules before ui.apps.
However, it will work only in below case

  • If it does have only HTL and/or HTML.
  • Specific component shouldn't be referencing to any other module.

eg. HTL may refer to Sling Model.
In such case you will have 2 options

  1. Make those references available to ui.apps by keeping everything under ui.apps module. (which is not recommended)
  2. Make available those references and deploy through another project.

For more details: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/developing/aem-project-content-package-structure.html?lang=en

Hope that helps!

Regards,
Santosh

Santosh Sai