build(render-docx): bring the PDF backend so the DOCX module works on its own - #722
Merged
Merged
Conversation
… its own Opening a DocumentSession resolves a font-metrics provider, and graph-compose-render-pdf is the only artifact that publishes one. The DOCX module declared it at test scope, so an application depending on graph-compose-core + graph-compose-render-docx failed at create() with MissingBackendException before it could export anything — while the class javadoc said that one artifact was all a DOCX consumer needed. The PDF backend is now a runtime dependency of the DOCX module, the way the PPTX module already brings it: nothing compiles against it through this module, and an application that declared it by hand resolves the same version. Checked with three consumer applications built outside the reactor against the installed artifacts — DOCX alone, PDF + DOCX, and PDF + PPTX + DOCX. Each exports, and each resolves one Apache POI (5.5.1, poi-ooxml-lite), one XMLBeans (5.3.0) and one PDFBox (3.0.8). The README, the package map, the troubleshooting entry and the class javadoc now say so, and the README notes the one-line Log4j notice POI prints without a logging provider and the bridge that routes it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
An application depending on
graph-compose-core+graph-compose-render-docxcould notexport a Word document. Opening a
DocumentSessionresolves a font-metrics provider, andgraph-compose-render-pdfis the only artifact that publishes one; the DOCX module declaredit at test scope, for its own suite. So the application failed before any export:
The README documented this as "not sufficient on its own", the release smoke scenario for
DOCX adds the PDF backend by hand to get past it, and the class javadoc said the opposite —
that the one artifact was all a DOCX consumer needed. With
session.buildDocx(...)on the2.5 line, adding the DOCX module and calling it is the path a caller will take first.
What changed
graph-compose-render-pdfis aruntimedependency ofgraph-compose-render-docx,the way
graph-compose-render-pptxalready brings it (at compile scope). Runtime ratherthan compile, so nothing compiles against the PDF backend through the DOCX module. There is
no working DOCX export without it — a session cannot open — so no consumer loses anything,
and one that declared it by hand resolves the same version.
The README says so, with the 2.4.x instruction kept for those versions; the package map, the
MissingBackendExceptiontroubleshooting entry and the class javadoc follow. The READMEalso notes what the dependency tree showed: POI logs through the Log4j API and prints one
ERROR Log4j API could not find a logging provider.line without a provider — a notice, nota failure — and
log4j-to-slf4jat the matching version routes it. That bridge isdocumented, not added: a library should not choose its consumers' logging binding.
Verification
Three consumer applications, built outside the reactor against the installed
2.5.0-SNAPSHOTartifacts, each opening a session and exporting through the session'sconvenience methods:
poi-ooxml-litepoi-ooxml-litepoi-ooxml-liteNo tree carries
poi-ooxml-fullbeside the lite schemas, and every tree resolves one versionof each — the three office backends share one schema set.
The defect was reproduced before the fix, not assumed: the DOCX-alone consumer with the PDF
backend excluded — the classpath the old test scope produced — fails at
create()with theMissingBackendExceptionabove. The Log4j bridge was checked the same way: the noticeappears once without it and not at all with it.
./mvnw -B -ntp clean verifyover the eight-module gate → BUILD SUCCESS (core 815,render-pdf 337, render-docx 248, testing 5, render-pptx 140, templates 127, qa 1788).
./mvnw -B -ntp test -f examples/pom.xml→ 93 tests, BUILD SUCCESS.Lane: build —
render-docx/pom.xmland documentation. No API change.Notes for review
The release smoke scenario
scripts/release-smoke/s8-core-render-docxstill declares the PDFbackend by hand. That is left as it is: the harness runs against a published version, and
for 2.4.1 the declaration is still needed. Once 2.5.0 is the version under test it becomes
redundant, and can be removed to make the scenario prove what this change makes true.
The consumer applications themselves are not committed: they run against installed
snapshots, which is what the release smoke harness exists to do against published versions.