Hi,
I just created my first java model (based on another that works, basically a copy) that has blocked the ability to deploy only ui.apps. If I deploy the whole project, it works just fine, otherwise it brings the cannot find symbol error with the class name I assigned. The model and impl filename appear in the web console here: Adobe Experience Manager Web Console - Sling Adapters and the impl is registered in Bundles. If I change the data-sly-use to an already existing model, it works fine as well.
To deploy I use the commands listed here. I rarely use the aem sync extension, however it works, even with this particular error.
<sly data-sly-use.header="com.xxx.core.models.PlatinumHeader"/>
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:compile (default-compile) on project aem-xxx-project.ui.apps: Compilation failure
[ERROR] /C:/../ui.apps/target/generated-sources/htl/org/apache/sling/scripting/sightly/apps/xxx/components/platinumheader/v1/platinumheader/platinumheader__002e__html.java:[41,86] cannot find symbol
[ERROR] symbol: class PlatinumHeader
[ERROR] location: package com.xxx.core.models
Thanks,
Views
Replies
Total Likes
@FabianAl1 how do you refer your core bundle in ui.apps? Basically you added Java class in core bundle project but your ui.apps project not able refer to your latest build core bundle. You either need to build your core bundle project first and refer that version in your ui.apps project as dependency or build whole project at once.
Views
Replies
Total Likes
Hi @Shashi_Mulugu, I checked, and it is being referred as @Karishma_begumSh said on the ui.apps/pom.xml with the same dependency for the core. Building the whole project at once with mvn clean install -PautoInstallPackage works and changes can be seen locally, but when I try to deploy front-end changes and compile only the ui.apps folder, it fails with the cannot find symbol error message. I try to deploy from ui.apps directly because I find it faster.
For the core only build I use mvn clean install -PautoInstallBundle, then on ui.apps I use mvn clean install -PautoInstallPackage.
Views
Replies
Total Likes
Hi @FabianAl1
HTL compilation in AEM occurs at build time in the ui.apps module.
Basically:
In ui.apps/pom.xml add dependecny in your core module
<dependency>
<groupId>com.xxx</groupId>
<artifactId>aem-xxx-project.core</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
Make a build after this mvn clean install -PautoInstallPackage.
After this, ui.apps can compile HTL referencing the new model because the compiler can see PlatinumHeader.
Hope this helpful 🙂
Regards,
Karishma.
Views
Likes
Replies
Views
Likes
Replies