Expand my Community achievements bar.

SOLVED

CIF core project is not compiling locally

Avatar

Level 8

Hello Team,

 

https://github.com/adobe/aem-core-cif-components

I have downloaded this CIF core project. Tried to run the command: mvn clean install -DskipTests its failing

same case with all forder. There also, project didnot compiled.

 

Can someone download the project and try compiling? For me, I wanted to modify the java files and wanted to build this core project only.

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 7

@Mahesh_Gunaje 

To make modifications to existing CIF core classes, you have to use sling model delegation pattern in your existing project

You should not modifying them in CIF core components project. Instead use them as dependency in your project and use sling model delegation to customize them as per your requirement

You can use Venia project as reference example. It shows an example of how an product teaser component is customized

https://github.com/adobe/aem-cif-guides-venia/blob/main/core/src/main/java/com/venia/core/models/com...

 

 

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @Mahesh_Gunaje 

Can you please share what error you are getting. 

Also you can try creating a project using the maven archtype. Add this property 

-D includeCommerce=y

 

Add CIF dependency 

<dependency>
<groupId>com.adobe.commerce.cif</groupId>
<artifactId>core-cif-components-apps</artifactId>
<type>zip</type>
<version>x.y.z</version>
</dependency>
<dependency>
<groupId>com.adobe.commerce.cif</groupId>
<artifactId>core-cif-components-config</artifactId>
<type>zip</type>
<version>x.y.z</version>
</dependency>
<dependency>
<groupId>com.adobe.commerce.cif</groupId>
<artifactId>core-cif-components-core</artifactId>
<version>x.y.z</version>
</dependency>
<dependency>
<groupId>com.adobe.commerce.cif</groupId>
<artifactId>graphql-client</artifactId>
<version>x.y.z</version>
</dependency>
<dependency>
<groupId>com.adobe.commerce.cif</groupId>
<artifactId>magento-graphql</artifactId>
<version>x.y.z</version>
</dependency>

 

And try building the project. 

Avatar

Level 8

Hi @ksh_ingole7 

 

Getting this error.

cif-core.png

Note: If I create a new AEM project with archetype including: 

-D includeCommerce=y, In this case, can I modify CIF core classes? I mean: com.adobe.cq.commerce.core.components.internal.models.v1.product.ProductImpl.java I dont think so.

Avatar

Level 7

Hi @Mahesh_Gunaje ,
Looks like in windows command prompt, it has some issue while compiling/installing the same. Problem is a rm command in a script which is not available for windows command prompt. 

To overcome the same , use a bash shell and compile the same. Tools like cygwin also can be helpful here.


Thanks,

Somen

Avatar

Correct answer by
Level 7

@Mahesh_Gunaje 

To make modifications to existing CIF core classes, you have to use sling model delegation pattern in your existing project

You should not modifying them in CIF core components project. Instead use them as dependency in your project and use sling model delegation to customize them as per your requirement

You can use Venia project as reference example. It shows an example of how an product teaser component is customized

https://github.com/adobe/aem-cif-guides-venia/blob/main/core/src/main/java/com/venia/core/models/com...