Skip to content

Apache POI is an API to access Microsoft Office files. This extension provides integration with Apache POI

License

Notifications You must be signed in to change notification settings

quarkiverse/quarkus-poi

Repository files navigation

Quarkus POI


Version License Build

This is a Quarkus extension for Apache POI.

What is Apache POI?

Apache POI is a Java API for Microsoft Documents. It allows Java programs to read and write files in Microsoft Office formats, such as Word, Excel and PowerPoint. It also allows programs to create new files in these formats. It is an open source project and is available under the Apache License.

Apache POI is a project of the Apache Software Foundation.

What is Quarkus?

Quarkus is a Kubernetes Native Java stack tailored for GraalVM & OpenJDK HotSpot, crafted from the best of breed Java libraries and standards.

How to use this extension?

Include the following dependency in your pom.xml:

<dependency>
    <groupId>io.quarkiverse.poi</groupId>
    <artifactId>quarkus-poi</artifactId>
    <version>${quarkus.poi.version}</version>
</dependency>

Features

This extension provides the following features:

  • Native image support
  • Support for Apache POI 5.2.3

Docker

When building native images in Docker using the standard Quarkus Docker configuration files some additional features need to be installed to support Apache POI. Specifically font information is not included in Red Hat's ubi-minimal images. To install it simply add these lines to your DockerFile.native file:

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9

######################### Set up environment for POI #############################
RUN microdnf update && microdnf install freetype fontconfig && microdnf clean all
######################### Set up environment for POI #############################

WORKDIR /work/
RUN chown 1001 /work \
    && chmod "g+rwX" /work \
    && chown 1001:root /work
# Shared objects to be dynamically loaded at runtime as needed,
COPY --chown=1001:root target/*.properties target/*.so /work/
COPY --chown=1001:root target/*-runner /work/application
# Permissions fix for Windows
RUN chmod "ugo+x" /work/application
EXPOSE 8080
USER 1001

CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]

Caution

Make sure .dockerignore does not exclude .so files!

Contributors ✨

Thanks goes to these wonderful people (emoji key):

George Gastaldi
George Gastaldi

💻 🚧
Tomaž
Tomaž

💻 🚧
Melloware
Melloware

📖 🐛 💻
Michael Schilling
Michael Schilling

🐛 ⚠️
manofthepeace
manofthepeace

🐛
Giancarlo Calderón Cárdenas
Giancarlo Calderón Cárdenas

📖
mschorsch
mschorsch

🐛

This project follows the all-contributors specification. Contributions of any kind welcome!