when trying to upgrade POM with version : 2025.1.19149.20250116T154450Z-241100 and found that test cases are failing with below error.
[ERROR] Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0 s <<< FAILURE! - in com.cbdt.core.userreport.services.impl.ReportStoreServiceImplTest
[ERROR] saveReport_whenStoreRootPathExists_thenNewReportPageIsCreatedBasedOnStoreOptions Time elapsed: 0 s <<< ERROR!
java.lang.NoSuchMethodError: 'void com.google.gson.internal.ConstructorConstructor.<init>(java.util.Map, boolean)'
at com.abc.core.userreport.services.impl.ReportStoreServiceImplTest.<init>(ReportStoreServiceImplTest.java:24)
However, the same test cases are passed with version :
2024.6.16799.20240614T073455Z-240500
The dependency for GSON is present, we have tried with 2.8.9 and 2.11.0 , but the issue remains the same and build is failing.
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.11.0</version>
</dependency>
The build is successful if the test cases are ignored.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @RK7 ,
Try adding the scope as test in the gson dependency.
The error is likely caused by a Gson version conflict between your project and the AEM SDK. Here's how to fix it:
1. Remove Gson version from your pom.xml to let AEM SDK manage it:
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
2. Check for conflicts using mvn dependency:tree to see if multiple Gson versions are being pulled in.
3. Clean and rebuild the project with:
mvn clean install
4. If needed, align the Gson version in your dependencyManagement section.
Hi @RK7 ,
Try adding the scope as test in the gson dependency.
Thank you for the quick fix I have the same issue, gson dependency has a test scope but its failing some of the tests. When reverting back to the version 2024 I don't have such problem.
Do you have any suggestion for me?
Thanks in advanced
Views
Replies
Total Likes
Tried with providing scope as test, still it gave the same issue.
Views
Likes
Replies
Views
Likes
Replies