Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Build failure when trying to use kendra API in Java

Avatar

Level 2

Hi, 

 

I have added the kendra dependency in core pom.xml and parent pom.xml. 

 

<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>kendra</artifactId>
<version>2.25.40</version>
</dependency>

 

there is no error in java class and there are no compilation errors in core folder as well. But we are getting the following error :

 

SushmaNa_0-1715095554024.png

 

 

 

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

4 Replies

Avatar

Level 2

Hi @EstebanBustamante 

 

Thanks for reply! 

 

I have followed the document you shared. I am getting different error now. 

SushmaNa_0-1715178380100.png

can you help with this ? 

 

Thanks!

Avatar

Community Advisor

Hi @SushmaNa ,

  1. Check Dependency Versions: Ensure that all dependencies in your project, including transitive dependencies, are using compatible versions. Sometimes, different dependencies might require conflicting versions of the same library, leading to such errors. If you're using any other AWS SDK dependencies, make sure they are compatible with the version of Kendra you're using.

  2. Check for Snapshot Dependencies: Snapshot dependencies are usually not recommended for production use because they are subject to changes. Check your pom.xml files for any dependencies that have -SNAPSHOT versions. If possible, try to replace them with stable versions.

  3. Dependency Tree: Use Maven's dependency tree to analyze which dependencies are bringing in the snapshot versions. You can use the following command to generate a dependency tree:

 

mvn dependency:tree

 

  1. This will give you an overview of all dependencies and their versions. Look for any snapshot versions and try to resolve them.

  2. Exclude Conflicting Transitive Dependencies: If a conflicting dependency is being pulled in transitively, you can exclude it and explicitly specify the version you want. For example:

 

<dependency>
    <groupId>some.group</groupId>
    <artifactId>conflicting-dependency</artifactId>
    <version>conflicting-version</version>
    <exclusions>
        <exclusion>
            <groupId>conflicting.group</groupId>
            <artifactId>conflicting-artifact</artifactId>
        </exclusion>
    </exclusions>
</dependency>

 

  1. Clean Maven Cache: Sometimes, Maven's local repository cache might get corrupted. Try cleaning the cache by deleting the .m2/repository directory in your user home directory. Then, re-run your Maven build. Maven will re-download dependencies, ensuring a clean state.

  2. Update Maven Plugin: Ensure that you're using the latest version of the Maven compiler plugin. Sometimes, outdated versions can lead to unexpected errors.

After performing these steps, rebuild your project and see if the issue persists. If the problem continues, the error message "all snapshot error" might indicate a specific issue with the Kendra dependency itself, in which case you might want to reach out to AWS support or check their documentation and forums for any known issues.

Avatar

Administrator

@SushmaNa Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni