Expand my Community achievements bar.

SOLVED

com.adobe.cq.commerce.core.components.models compilation error 3.8.1

Avatar

Level 2

Hi , I have generated wknds project archetype mentioned as per the wknds project setup doc and project got created, while building the project I'm seeing below error for ui.apps

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project aem-guides-wknd.ui.apps: Compilation failure
[ERROR] /C:/Users/Desktop/AEM/wknd_6.5/aem-guides-wknd/ui.apps/target/generated-sources/htl/org/apache/sling/scripting/sightly/apps/wknd/components/commerce/logo/logo__002e__html.java:[46,95] package com.adobe.cq.commerce.core.components.models.header does not exist

I'm using Maven : apache-maven-3.9.0-bin and Java : 11.0.15.1. please let me know if anyone the root cause for this issue.

Thanks in advance.

 

1 Accepted Solution

Avatar

Correct answer by
Level 7

Hi @sams16001423 

 

Can you run the given maven command in command prompt terminal with administrator rights. It worked as expected and build is success

 

->  To start command prompt with admin rights, right click on cmd and click on run as administrator

 

Hope this helps

View solution in original post

4 Replies

Avatar

Level 7

Hi @sams16001423 

 

Can you check if core components dependency is updated in respective pom.xml and whether the version is compatible or not -

 

If you're using AEMasCS, core component package will comes with SDK

 

<dependency>
<groupId>com.adobe.cq</groupId>
<artifactId>core.wcm.components.core</artifactId>
<version>${core.wcm.components.version}</version>
</dependency>
<dependency>
<groupId>com.adobe.cq</groupId>
<artifactId>core.wcm.components.content</artifactId>
<type>zip</type>
<version>${core.wcm.components.version}</version>
</dependency>
<dependency>
<groupId>com.adobe.cq</groupId>
<artifactId>core.wcm.components.config</artifactId>
<type>zip</type>
<version>${core.wcm.components.version}</version>
</dependency>

 Hope this helps

Avatar

Level 2

Hi @PRATHYUSHA_VP I have used below command to generate project which is not AEMasCS

mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=39 -D appTitle="WKND Sites Project" -D appId="wknd" -D groupId="com.adobe.aem.guides" -D artifactId="aem-guides-wknd" -D package="com.adobe.aem.guides.wknd" -D version="0.0.1-SNAPSHOT" -D aemVersion="6.5.20.0" 

 

I have added below dependency in ui.apps pom.xml file

 <dependency>
            <groupId>com.adobe.cq</groupId>
            <artifactId>core.wcm.components.core</artifactId>
<version>${core.wcm.components.version}</version>
        </dependency>
 
        <dependency>
            <groupId>com.adobe.cq</groupId>
            <artifactId>core.wcm.components.content</artifactId>
            <type>zip</type>
<version>${core.wcm.components.version}</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.cq</groupId>
            <artifactId>core.wcm.components.config</artifactId>
            <type>zip</type>
<version>${core.wcm.components.version}</version>
        </dependency>

 

Still I see same error as below

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project aem-guides-wknd.ui.apps: Compilation failure
[ERROR] /C:/Users/Desktop/xxxxxxxx/aem-guides-wknd/ui.apps/target/generated-sources/htl/org/apache/sling/scripting/sightly/apps/wknd/components/commerce/logo/logo__002e__html.java:[46,95] package com.adobe.cq.commerce.core.components.models.header does not exist

Avatar

Correct answer by
Level 7

Hi @sams16001423 

 

Can you run the given maven command in command prompt terminal with administrator rights. It worked as expected and build is success

 

->  To start command prompt with admin rights, right click on cmd and click on run as administrator

 

Hope this helps

Avatar

Administrator

@sams16001423 Did you find the suggestion helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!



Kautuk Sahni