com.google.gson.internal -- Cannot be resolved

Accepted Solutions (1)

Accepted Solutions (1)

Veena_Vikram

MVP

11-06-2020

Which version of AEM are you using @sathyaprakasha2 . In most of the latest version of AEM , google gson  bundle should be available in the felix console already. Can you check /system/console/depfinder and search for the archetype you want to install ? 

I have 6.5 version and I already have gson in my felix console. PFB the screenshot.  You can copy the dependency from here and add it in the pom.xml files under <dependencyManagement><dependencies> section.

 

 1) Add below dependency on your main pom.xml

<dependency>
	<artifactId>gson</artifactId>
	<version>2.8.5</version>
	<groupId>com.google.code.gson</groupId>
	<scope>provided</scope>
</dependency>

2) Add the below in your core/pom.xml

<dependency>
	<artifactId>gson</artifactId>
	<groupId>com.google.code.gson</groupId>
</dependency>

 

dep1.JPG

 

If it is not available in your Felix console , then you can treat it as a third party bundle and follow the article mentioned by @Ankur_Khare 

 

Hope this helps 🙂

Answers (2)

Answers (2)

surabhikatiyar

Employee

11-06-2020

In maven-bundle-plugin, <wrapImportPackage>;</wrapImportPackage>  would add all your dependencies as resources in the generated jar file and configure the bundle classpath for you.
bnd-maven-plugin does not use instructions in the POM. You have to do that in bnd file. in the link provided below will show you an example of -includeresource instruction and how to set your bundle classpath.

 

Please check the document for more information:

 

1. https://help.liferay.com/hc/en-us/articles/360018162491-Resolving-Third-Party-Library-Package-Depend...