Maven dependency when using opencsv : Unable to start bundle
I am trying to use opencsv in my AEM project. For that I have added the maven dependency as below in my core bundle pom.xml.
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>4.1</version>
</dependency>
But after adding this dependency, my project bundle is showing installed status and I can see the below when anlaying the bundle.
org.apache.log -- Cannot be resolved
org.apache.avalon.framework.logger -- Cannot be resolved
Error.log :
missing requirement - Unresolved requirements: osgi.wiring.package; (osgi.wiring.package=org.apache.log)
Can someone help me understand if we need to add any more maven dependency when using opencsv in AEM?
Answer:
Thanks @arpitvarshney for helping me fix this issue and Thank you @albinis1 for the valuable comments.
Adding the below dependencies in import-packages helped me resolve my issue. My bundles are up and running now.
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
!org.apache.log,
!org.apache.avalon.framework.logger
</Import-Package>
<Embed-Dependency>*;
|opencsv
</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>
