I'm installing an OSGi bundle on my AEM environment as a jar.
During that I get the following error after installing the bundle:
org.json.simple -- Cannot be resolved
I have declared the dependency in Maven and my program is running fine on local.
My maven dependency is as follows:
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
Do I need to add any more dependencies to resolve the error? I'm relatively new to maven and this is one of the first bundle that I'm developing.
Change your maven bundle configuration
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<configuration>
<instructions>
<Embed-Dependency>*;scope=compile;inline=false</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>
There are some transitive dependencies that it needs which should get fixed by code above
Yes - you have to wrap this JAR into an OSGi bundle and deploy that bundle to AEM.
See this AEM Artilce that shows you how to use this JSON lib in AEM:
http://scottsdigitalcommunity.blogspot.ca/2013/06/posting-form-data-to-adobe-cq-using.html
This shows you exactly how to perform this use case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With