hi folks,
I have GSON 2.8.0 but I've been told to upgrade to 2.8.9.
Just editing the Pom file doesn't seem to work for me. Cloudmanager doesn't find the updated GSON.
I changed my main pom.xml file.
Any ideas what I'm doing wrong.? Could it be my UBER jar api version?
thanks
Fiona
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>
Solved! Go to Solution.
Views
Replies
Total Likes
I solved this by deleting some of my unit tests that used GSON. There is some mismatch with the junit and GSON versions.
@fionas76543059 ,you need to explicitly override it.
Use <dependencyManagement>, and ensure the scope is not limited
<dependencyManagement> <dependencies> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.8.9</version> <scope>compile</scope> </dependency> </dependencies> </dependencyManagement>
You will then also need to reference that dependency in your <dependencies> section in the module(s) where you use GSON, but without a <version> tag:
<dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> </dependency>
This ensures over the Uber Jaryour version wins .
We can also try to exclude the dependency from Uber.jar.
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>${aem.uber.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
</exclusions>
</dependency>
Thanks folks. I tried the above exclusons idea with different versions of GSON.
2.8.9 didn't work.
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
<scope>compile</scope>
</dependency>
I tried 2.10.1 which produces this message.
ERROR!
java.lang.NoSuchMethodError: com.google.gson.internal.ConstructorConstructor
Any suggestions? Our uberjar api is just set to 6.5.0 since our 6.5 upgrade
Views
Replies
Total Likes
If I try 2.8.9 GSON, I get this problem in a Unit test
Gson gson = new Gson();
ERROR!
java.lang.NoSuchFieldError: FACTORY
I solved this by deleting some of my unit tests that used GSON. There is some mismatch with the junit and GSON versions.
Views
Likes
Replies
Views
Likes
Replies