Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

API Dependency not resolved

Avatar

Community Advisor

I have included a below dependency in my project ( AEM 6.1 )

<dependency> <groupId>com.adobe.cq.commerce</groupId> <artifactId>cq-commerce-core</artifactId> <version>5.13.12</version> <scope>provided</scope> </dependency>

I have checked in the depfinder and used the same version aswell.

When I deploy, bundle is in installed state with the below error

     
Imported Packagescom.adobe.cq.commerce.api,version=[1.2,2) -- Cannot be resolved

 

Anybody encountered the same and know what is the issue, do let me know 

 

Thanks!

2 Replies

Avatar

Administrator

Hi Lokesh,

I have asked internal Team with this query.

I will revert you back soon.

Thanks and Regards

Kautuk Sahni

Avatar

Community Advisor

Thanks Kautuk!

Even in 6.2, I get the below error

     
Imported Packagescom.adobe.cq.commerce.api,version=[3.4,4) -- Cannot be resolved
 

 

with the dependency used as per the depfinder

<dependency> <groupId>com.adobe.cq.commerce</groupId> <artifactId>cq-commerce-core</artifactId> <version>5.14.102</version> <scope>provided</scope> </dependency>

Avatar

Employee Advisor

I found that the commerce.api package is exported by the cq-commerce-core bundle in 6.2. There is no separate bundle which exports the commerce API. Therefore, you can try with the following dependency in your project- 

<dependency> <groupId>com.adobe.cq.commerce</groupId> <artifactId>cq-commerce-core</artifactId> <version>5.14.102</version> <scope>provided</scope> </dependency>

Avatar

Community Advisor

Hi Kunal,

for AEM 6.2, I have used the same version of dependency as I have mentioned.

Avatar

Level 1

Hi @Kunal123 for the dependency 

  <dependency>
            <groupId>com.adobe.cq.commerce</groupId>
            <artifactId>cq-commerce-core</artifactId>
            <version>5.14.102</version>
            <scope>provided</scope>
        </dependency>

we are not finding it in any repository.

Can you please help us finding it. We tried 5.13 but it is for aem 6.0 or lower only. 

Avatar

Employee

Lokesh, what;s the version for commerce core bundle available in your 6.1 installation, is that 5.13.12? DO you have SP1 installed?

Avatar

Community Advisor

Hi Vijesh, 

Yes, it is 5.13.12 which is available as I have mentioned in the post. I have not installed SP1 but not sure if that impacts anyway ! 

I am seeing similar error on 6.2 aswell for the available bundle version.

Avatar

Level 4

HI Lokesh,

I was also facing the same problem(AEM 6.2).

But how i have resolved this as , we were including following dependencies in our pom.xml-

 

    <dependency>
            <groupId>com.adobe.aem</groupId>
            <artifactId>aem-api</artifactId>
        </dependency>

     <dependency>
            <groupId>com.adobe.cq.commerce</groupId>
            <artifactId>cq-commerce-core</artifactId>
            <version>5.14.102</version>
            <scope>provided</scope>
        </dependency>

 

I suppose there order also matters as all the classes were pointing to aem-api jar and not to commerce jar.

When we changed the order in pom.xml as follows-

 

  <dependency>
            <groupId>com.adobe.cq.commerce</groupId>
            <artifactId>cq-commerce-core</artifactId>
            <version>5.14.102</version>
            <scope>provided</scope>
        </dependency>

<dependency>
            <groupId>com.adobe.aem</groupId>
            <artifactId>aem-api</artifactId>
        </dependency>
   It started working.

You can also try at your end.

Avatar

Level 4

Is this issue resolved? We are facing same issue in both 6.1 and 6.2 as well?

Avatar

Level 5

samery56615784 wrote...

Is this issue resolved? We are facing same issue in both 6.1 and 6.2 as well?

 

is this issue resolve, same issue i am also facing with 6.1. We have not added any dependency in any of the pom file for commerce, please help

Avatar

Community Advisor

Hi @sandeepm744005 @rahul kumar11,

Yes, I was able to resolve this issue by using latest version of uber-jar.

You can refer to this article to know more..

https://helpx.adobe.com/experience-manager/using/ecommerce62.html 

Avatar

Level 10

To all facing this issue, join Ask the experts next tues. Lokesh is the presenter and will be covering this topic. Sign up here: http://scottsdigitalcommunity.blogspot.ca/2016/08/working-with-aem-ecommerce-august-2016.html

Avatar

Employee Advisor

Hi,

looks like that there has been some change in the Commerce API. Please check the version of the java package "com.adobe.cq.commerce.api", which is exported by the "cq-commerce-core" bundle. You can find this information in the bundle details of this bundle on the OSGI webconsole. It should be version 3.1.0.

So it rather looks like your bundles which depend on this commerce API are built with the wrong dependency. They should have an import statement like "version=(3.4]" to make the import work. You might want to check the uber.jar for the correct export statment and maybe overwrite this export in maven.

Jörg