When adding a new dependency in the POM file of an OSGI bundle (which is deployed inside an AEM package to CRX) I will often see a number of unresolved dependencies in the OSGI console. The bundle will fail to activate.
Example:
org.jaxen.dom -- Cannot be resolved
org.jaxen.dom4j -- Cannot be resolved
org.jaxen.jdom -- Cannot be resolved
org.jaxen.pattern -- Cannot be resolved
org.jaxen.saxpath -- Cannot be resolved
org.jdom -- Cannot be resolved
org.jdom.input -- Cannot be resolved
org.jdom.output -- Cannot be resolved
How can I debug this type of problem? How can I understand why those dependencies are required yet cannot be resolved?
I can see in the POM that the bundle has been configured as follows:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-Activator>com.mycompany.aem.Activator</Bundle-Activator>
<Export-Package>
com.mycompany.aem.*
</Export-Package>
<Sling-Model-Packages>
com.mycompany.aem.components.page,
com.mycompany.aem.models,
com.mycompany.aem.helper
</Sling-Model-Packages>
<Include-Resource>{maven-resources}</Include-Resource>
<Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Import-Package>
android.util.*;resolution:=optional,
javax.validation.*;resolution:=optional,
org.apache.axiom.*;resolution:=optional,
org.apache.cxf.*;resolution:=optional,
!com.sun.msv.*;resolution:=optional,
!com.sun.xml.bind.marshaller.*;resolution:=optional,
!com.sun.xml.fastinfoset.stax.*;resolution:=optional,
!net.sf.cglib.*;resolution:=optional,
!org.apache.aries.*;resolution:=optional,
org.apache.axiom.*;resolution:=optional,
org.apache.mina.*;resolution:=optional,
org.osgi.service.blueprint.*;resolution:=optional,
!org.relaxng.*;resolution:=optional,
!org.springframework.*;resolution:=optional,
!javax.resource.*;resolution:=optional,
!javax.xml.ws.spi.http.*;resolution:=optional,
!com.sun.*;resolution:=optional,
sun.*;resolution:=optional,
org.apache.*;resolution:=optional,
org.jvnet.*;resolution:=optional,
*
</Import-Package>
</instructions>
</configuration>
</plugin>