poi/osgi
Marius Volkhart 259c9967ef [bug-63046] Use Log4j 2 for logging
This removes the POILogger and POILogFactory mechanism for logging. This mechanism was created at a time when the Java landscape looked very different than it does today.

Log4j 2 is an Apache Foundation project that is well maintained and is widely regarded as having good performance and capabilities. We use only the Log4j API artifact. This lets application developers choose how they want to capture logging events if at all. Integrations with Log4j 2 Core and Logback are available from the Log4j project.

Closes #224

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1886770 13f79535-47bb-0310-9956-ffa450edef68
2021-02-21 20:57:25 +00:00
..
src OSGi support: register service providers in bundle activator 2020-09-22 12:42:18 +00:00
README.md [bug-63046] Use Log4j 2 for logging 2021-02-21 20:57:25 +00:00
pom.xml [bug-63046] Use Log4j 2 for logging 2021-02-21 20:57:25 +00:00

README.md

Apache POI OSGi Bundle

The POI bundle is an Uber jar which exports all the POI classes, XML Beans, OOXML Schemas and required dependencies. The current size is around 21 MB. The bundle is self-contained and can be used out of the box in a bare OSGi container.

Embedded Dependencies

The bundle embeds all the jars from lib/main:

  • SparseBitSet
  • curvesapi
  • commons-math3
  • commons-compress
  • commons-collections4
  • commons-codec
  • Log4j 2 API

Optional Dependencies

  1. Apache Batik Required to render WMF/EMF images. The OSGi bundle is provided by ServiceMix and available in Maven Central: https://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.batik/1.14_1

  2. Saxon Required if using as the XSLT and XQuery Processor engine in XML Beans. Available in Maven Central: https://mvnrepository.com/artifact/net.sf.saxon/saxon/8.9.0.4-osgi

  3. Apache XML Security for Java, Bouncy Castle and XML Commons Resolver These are required to sign or validate signed Office documents. The OSGi bundles are available in Maven Central:

  4. PDFBox and PDFBox Graphics2D
    Required to render to PDF documents. The required jars can be downloaded from:

Blocked Imports

The Bundle Maven Plugin performs a thorough inspection of the dependencies on external packages and by default includes them all in the section.

Transitive dependencies from XML Beans not required by POI:

- !com.github.javaparser.*,
- !org.apache.tools.ant.*

Optional codecs pulled by Commons-Compress. Not used by POI

- !com.github.luben.zstd.*,
- !org.tukaani.xz.*,
- !org.brotli.dec.*,

Internal APIs which are no more in JPMS

- !sun.misc.*

Integration Testing

The project tests the bundle using the Pax Exam framework which executes junit tests within an OSGi container started by Maven. The current version uses the Apache Felix driver but the framework should not matter, same tests will pass with the Karaf or Equinox drivers.

When running integration tests Maven starts a bare Apache Felix OSGi container, deploys the POI bundle and runs a few simple tests to validate the code is working fine, e.g. create a spreadsheet, serialize it to a byte array and read back.