Reputation: 70
In AEM, there's a bundle named "OSGi Bundle Wrapper For The Apache POI Library".
I want to update POI version of that bundle to use POI 5.2.3 with AEM 6.3.
Is there's any way to easily update POI version in this bundle?
Thanks.
Upvotes: 1
Views: 302
Reputation: 106
Apache POI provides a module to build an all-in-one OSGi bundle, see https://github.com/apache/poi/tree/trunk/osgi
It can either replace the OOB POI bundle, or you can build your own one on top of it, having the POI code in the internal classpath.
Upvotes: 1
Reputation: 353
In your custom core bundle pom, you may specify embed dependency for the poi version you require. So that your bundle will refer to the poi version from embedded jar and not provided by AEM container.
Have you tried using the tag of maven-bundle-plugin -
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version></version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Name>${bundle.name}</Bundle-Name>
<Export-Package>${bundle.namespace}</Export-Package>
<Bundle-Activator>Activator.class</Bundle-Activator>
<Embed-Dependency>*;scope=!provided|test;groupId=!org.mybundle.test</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Import-Package>*;resolution:=optional</Import-Package>
</instructions>
</configuration>
</plugin>
You can either include all the dependencies or you can configure to not to include specific ones. The scope attribute lets you configure which dependency jars you want to include based on their include scope. You should not include the dependencies which are only needed for compile and for test.
Upvotes: 1