How do I reference an OSGi bundle in my Java class or POM file?
We are developing a proof of concept using AEM Correspondence Management and need to do a call to a REST service to retrieve data to prefill the correspondence letter templates. To do the POST we are trying to use com.sun.jersey.api.client which we have in our Maven repository and have also successfully built as a bundle in system/console/bundles according to: Adobe Experience Manager Help | Submitting Adobe Experience Manager form data to Java Sling Servlets under the section To create an OSGi bundle fragment that contains the org.json.simple.JSONObject class, perform these tasks.
However, although we reference this in our POM file, the imports are not resolving. Is there something we need to do within our POM file or somewhere else to reference the OSGi bundle we have installed?
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
</dependency>
java.lang.Error: Unresolved compilation problems:
The import com.sun.jersey cannot be resolved
The import com.sun.jersey cannot be resolved
The import com.sun.jersey cannot be resolved
Client cannot be resolved to a type
Client cannot be resolved
WebResource cannot be resolved to a type
ClientResponse cannot be resolved to a type
ClientResponse cannot be resolved to a type
ClientResponse cannot be resolved to a type
Thank you!