Expand my Community achievements bar.

SOLVED

Dependency for package com.adobe.cq.social.scf

Avatar

Level 2

Hello! I have java files that import package like this 

 

`import com.adobe.cq.social.scf.OperationException;`

 

But during maven build I get error `package com.adobe.cq.social.scf does not exist`

I'm using maven 3.8.7 and <aem.sdk.api>2023.4.11835.20230414T234523Z-230200</aem.sdk.api>

 

Could you advise which dependency should be added to pom.xml to avoid such errors and getting right cq.social package?

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @DmitryOs1 

 

For any missing dependency, you can check the version that your AEM uses via 

http://localhost:4502/system/console/depfinder

 

Just add full-qualified package/classname in the textbox and click Enter. You would see a maven dependency with version under "Maven Dependencies" column. 

aanchalsikka_1-1688104195553.png

 

  1. If you have added new dependencies in a project, always try running "mvn clean install" via terminal and command prompt first. 
    • These are up-to-date with any maven downloads while executing mvn commands. So, the errors that you see would be actual things missing in the project. So, just use the depfinder and add the missing depdencies
  2. Once the command is resolved in terminal/command-prompt, update IDE to recognize the additional maven dependency downloads. Example: for IntelliJ, Right click on maven project -> Maven -> Reload project.

 

 

 


Aanchal Sikka

View solution in original post

9 Replies

Avatar

Community Advisor

Hello @DmitryOs1 - 

 

To resolve the error `package com.adobe.cq.social.scf does not exist`, you need to include the appropriate Maven dependency in your `pom.xml` file. In this case, the `cq-socialcommunities-api` dependency provides the required `com.adobe.cq.social.scf` package.

 

To add the dependency to your `pom.xml`, you can include the following XML snippet within the `<dependencies>` section:

 


<dependency>
<groupId>com.adobe.cq</groupId>
<artifactId>cq-socialcommunities-api</artifactId>
<version>[version]</version>
<scope>provided</scope>
</dependency>

Replace [version] with the specific version you are using.

Avatar

Level 2

Thanks! I have already this dependency in pom

<dependency>
<groupId>com.adobe.cq.social</groupId>
<artifactId>cq-socialcommunities-api</artifactId>
<version>1.7.197</version>
<scope>provided</scope>
</dependency>

but get such errors : `package com.adobe.cq.social.srp.utilities.api does not exist` `package com.adobe.cq.social.scf does not exist`

 

May be I need another version? Could you advise which one?

Avatar

Community Advisor

@DmitryOs1 - 

 

Try adding below dependency once? 

 

<dependency>
    <groupId>com.adobe.cq</groupId>
    <artifactId>cq-social-srp-utilities-api</artifactId>
    <version>[version]</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.adobe.cq.social</groupId>
    <artifactId>cq-social-srp-utilities</artifactId>
    <version>[version]</version>
    <scope>provided</scope>
</dependency>

Avatar

Level 2

Could tell how to understand which version should I paste to [version]? I have `1.7.197` now, looks like it needs to be higher

Avatar

Community Advisor

Are you seeing this issue in your IDE? Did you try to run mvn clean command?, Sometimes the IDE require to "clean" the project to rebuild the PATH and dependencies appended to it



Esteban Bustamante

Avatar

Correct answer by
Community Advisor

Hello @DmitryOs1 

 

For any missing dependency, you can check the version that your AEM uses via 

http://localhost:4502/system/console/depfinder

 

Just add full-qualified package/classname in the textbox and click Enter. You would see a maven dependency with version under "Maven Dependencies" column. 

aanchalsikka_1-1688104195553.png

 

  1. If you have added new dependencies in a project, always try running "mvn clean install" via terminal and command prompt first. 
    • These are up-to-date with any maven downloads while executing mvn commands. So, the errors that you see would be actual things missing in the project. So, just use the depfinder and add the missing depdencies
  2. Once the command is resolved in terminal/command-prompt, update IDE to recognize the additional maven dependency downloads. Example: for IntelliJ, Right click on maven project -> Maven -> Reload project.

 

 

 


Aanchal Sikka

Avatar

Community Advisor

@DmitryOs1  Can the depdency file in below location with the releasted versions

 

https://mvnrepository.com/artifact/com.adobe.cq.social/cq-socialcommunities-api/1.7.197

 

1.7.197 is the version of Communities that shipped in AEM 6.1.  It looks like there's a bug in the pom for 1.7.197.

It is strongly recommended that you install the latest feature pack for social communities.

See http://docs.adobe.com/docs/en/aem/6-1/deploy/communities.html

If you install FP3, then the version would change to 1.8.305.

If you wanted to stay on 1.7 (not recommended), then you'd at least want to apply the fix pack which would give you version 1.7.199.

Avatar

Level 2

Thank you! Could you tell which version of social communities is used with 6.5 AEM I think I have latest aem (<aem.sdk.api>2023.4.11835.20230414T234523Z-230200</aem.sdk.api>)

Looks like 1.8.305 is for older version