Hi Team,
How to add embed-dependency in bnd-maven-plugin. wanna add com.google.gson
com.google.gson.internal -- Cannot be resolved
Solved! Go to Solution.
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>
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
Refer this link where @veena vikaram explained it nicely-
https://www.linkedin.com/pulse/how-add-third-party-bundle-you-aem-package-veena-vikraman/
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>
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
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
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:
You're supposed to be directly referencing anything in the com.google.gson.internal package... that's why it's called "internal".
See the big warning on the GSON JavaDocs site for these internal packages [1] that reads: Do NOT use any class in this package as they are meant for internal use in Gson. Infact, this package is no longer exported at all in later versions of GSON.
The fix is to update your code to depend on Gson's public API space.
[1] https://javadoc.io/doc/com.google.code.gson/gson/1.7.2/com/google/gson/internal/package-summary.html