Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

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

Avatar

Level 5

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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.

Avatar

Community Advisor

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/develo...

Hope that helps!

Regards,
Santosh