Слияние docx4j 17.3.5 в wordpdf-core и форк FO-рендерера 2.11-docx4j.8 в реактор
- wordpdf-core/src/main/java впитаны исходники docx4j-core, -export-fo, -chart-render, -JAXB-ReferenceImpl, -copy, -generated-objects (17.3.5) + сгенерированная XJC JAXB-модель; ресурсы — тем же путём; артефакты группы org.docx4j из внешних репозиториев больше не подключаются - vendor/fop: форк docx4j-fo-renderer 2.11-docx4j.8 (util/events/core/fop) собирается в реакторе вместо jar из Nexus - docx2fo.xslt перевендорен со стилем 17.3.5, оба AUDIT-FIX-патча перенесены; дрейф-гейт vendoredXsltTracksJarCopy зелёный - upstream-тесты docx4j перенесены в src/test/java/org (658 классов, вне гейта); execution upstream-docx4j-tests в профиле upstream-tests (./mise.sh run upstream-tests, в pr.yml non-blocking шаг): 3470 тестов, 3457 зелёных, 13 красных — категории окружения/калибровки хоста и следствий слияния classpath задокументированы в docs/agent/testing.md - surefire: провайдер SLF4J фиксируется коротким slf4j.provider по execution; перенесён upstream logback.xml (root=DEBUG без конфига ломает visitor-экспорт VML); upstream-форки пинят JDK JAXP-фабрики; PMD/JaCoCo исключают org/** - wordpdf-app: без изменений кода (зависит от слитого ядра); тесты 44/44 - документация синхронизирована (AGENTS.md, README, docs/agent/*), mise task upstream-tests
This commit is contained in:
+368
-14
@@ -12,24 +12,153 @@
|
||||
|
||||
<artifactId>wordpdf-core</artifactId>
|
||||
<name>wordpdf-core</name>
|
||||
<description>Библиотека: конвертация docx в PDF (docx4j + FOP, шрифты внутри jar)</description>
|
||||
<description>Библиотека: конвертация docx в PDF (docx4j 17.3.5 слит в модуль, FOP-форк из vendor/fop, шрифты внутри jar)</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- docx4j: чтение/запись docx, маппинг шрифтов -->
|
||||
<!-- ============ зависимости слитого docx4j 17.3.5 (org.docx4j.* в src/main/java) ============
|
||||
Единственные артефакты группы org.docx4j на classpath — форк FO-рендерера
|
||||
(reactor-модуль vendor/fop); docx4j-core/export-fo/chart-render из Central НЕ
|
||||
используются. Версии — в корневом dependencyManagement (upstream 17.3.5). -->
|
||||
|
||||
<!-- JAXB: API + реализация ReferenceImpl (service-файл jaxb-runtime), txw2 -->
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>jaxb-runtime</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>jaxb-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>txw2</artifactId>
|
||||
</dependency>
|
||||
<!-- рантайм XJC-плагинов модели (-Xcopy: org.docx4j.copy.* слиты сюда же) -->
|
||||
<dependency>
|
||||
<groupId>org.jvnet.jaxb</groupId>
|
||||
<artifactId>jaxb-plugins-runtime</artifactId>
|
||||
</dependency>
|
||||
<!-- перепакованные схемы SVG/XSL-FO -->
|
||||
<dependency>
|
||||
<groupId>org.plutext</groupId>
|
||||
<artifactId>jaxb-svg11</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.plutext</groupId>
|
||||
<artifactId>jaxb-xslfo</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.engio</groupId>
|
||||
<artifactId>mbassador</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>SparseBitSet</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>xmlgraphics-commons</artifactId>
|
||||
</dependency>
|
||||
<!-- перепакованный Xalan для XPathEnhancer -->
|
||||
<dependency>
|
||||
<groupId>org.docx4j.org.apache</groupId>
|
||||
<artifactId>xalan-interpretive</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.docx4j.org.apache</groupId>
|
||||
<artifactId>xalan-serializer</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr-runtime</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>stringtemplate</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.checkerframework</groupId>
|
||||
<artifactId>checker-qual</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.errorprone</groupId>
|
||||
<artifactId>error_prone_annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.thoughtworks.qdox</groupId>
|
||||
<artifactId>qdox</artifactId>
|
||||
</dependency>
|
||||
<!-- Batik: SVG/OMML (jeuclid) и chart-render -->
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-anim</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-awt-util</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-bridge</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-codec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-dom</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-extension</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-gvt</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-svggen</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>batik-transcoder</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.rototor.jeuclid</groupId>
|
||||
<artifactId>jeuclid-fop</artifactId>
|
||||
</dependency>
|
||||
<!-- форк FO-рендерера: собирается reactor-модулем vendor/fop (2.11-docx4j.8) -->
|
||||
<dependency>
|
||||
<groupId>org.docx4j</groupId>
|
||||
<artifactId>docx4j-core</artifactId>
|
||||
<artifactId>docx4j-fo-renderer</artifactId>
|
||||
</dependency>
|
||||
<!-- Реализация JAXB для docx4j -->
|
||||
<dependency>
|
||||
<groupId>org.docx4j</groupId>
|
||||
<artifactId>docx4j-JAXB-ReferenceImpl</artifactId>
|
||||
</dependency>
|
||||
<!-- Пайплайн экспорта: docx -> XSL-FO -> Apache FOP -> PDF -->
|
||||
<dependency>
|
||||
<groupId>org.docx4j</groupId>
|
||||
<artifactId>docx4j-export-fo</artifactId>
|
||||
<artifactId>docx4j-fo-renderer-events</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Простой логгер в консоль (slf4j). Обязателен: без него docx4j
|
||||
пишет предупреждение прямо в выходной PDF. -->
|
||||
<dependency>
|
||||
@@ -50,8 +179,8 @@
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
</dependency>
|
||||
<!-- Используется DependencyGuard (проверка совместимости classpath);
|
||||
транзитивно приходит от docx4j-core, объявлена явно как контракт
|
||||
интеграции — потребитель видит её в своём дереве зависимостей -->
|
||||
объявлена явно как контракт интеграции — потребитель видит её в
|
||||
своём дереве зависимостей -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
@@ -76,12 +205,112 @@
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- ===== upstream-набор тестов docx4j (JUnit 4 через vintage) ===== -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- тесты upstream работают против logback-бэкенда (LoggerContext/ListAppender);
|
||||
в гейт по умолчанию не попадает: default-test фиксирует slf4j-simple через
|
||||
-Dslf4j.provider -->
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- Saxon XPath (тесты mc-preprocessor/XSLT), tika (детект MIME),
|
||||
xerces (DOM-каноникализация), fop-hyph (флекс-расстановка) -->
|
||||
<dependency>
|
||||
<groupId>net.sf.saxon</groupId>
|
||||
<artifactId>Saxon-HE</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tika</groupId>
|
||||
<artifactId>tika-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.offo</groupId>
|
||||
<artifactId>fop-hyph</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- main-код docx4j-markdown перенесён в test-дерево (нужен тестам core-tests) -->
|
||||
<dependency>
|
||||
<groupId>org.commonmark</groupId>
|
||||
<artifactId>commonmark</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.commonmark</groupId>
|
||||
<artifactId>commonmark-ext-gfm-tables</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.commonmark</groupId>
|
||||
<artifactId>commonmark-ext-gfm-strikethrough</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.commonmark</groupId>
|
||||
<artifactId>commonmark-ext-task-list-items</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.commonmark</groupId>
|
||||
<artifactId>commonmark-ext-footnotes</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.commonmark</groupId>
|
||||
<artifactId>commonmark-ext-yaml-front-matter</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<!-- XSLT-части src/main/java: стилист export-fo (org/docx4j/convert/out/fo/docx2fo.xslt)
|
||||
и xml-части лежат в дереве исходников — без этой записи они не попадут в jar,
|
||||
и гейт vendoredXsltTracksJarCopy упадёт. -->
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<!-- фильтруется вторым ресурсом: ${docx4j.version} = 17.3.5 -->
|
||||
<exclude>docx4j_version.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>docx4j_version.properties</include>
|
||||
</includes>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.xslt</include>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<!-- Тестовый jar с готовыми .docx из src/test/resources/samples:
|
||||
используется тестами wordpdf-app. -->
|
||||
используется тестами wordpdf-app. В jar попадают только фикстуры
|
||||
проекта (samples/, geom/) и тестовые классы ru.pjandro — перенесённые
|
||||
upstream-тесты (org/**) и их 60 МБ ресурсов в app не нужны. -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
@@ -91,15 +320,75 @@
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>ru/pjandro/**</include>
|
||||
<include>samples/**</include>
|
||||
<include>geom/**</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- Разделение наборов: гейт по умолчанию — только тесты проекта;
|
||||
upstream-набор — в профиле upstream-tests (см. ниже). -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-test</id>
|
||||
<configuration>
|
||||
<!-- slf4j-бэкенд тестов проекта — slf4j-simple (as prod);
|
||||
logback-classic на test-classpath нужен только
|
||||
upstream-тестам, провайдер фиксируем явно -->
|
||||
<argLine>@{argLine} -Djava.awt.headless=true -Dslf4j.provider=org.slf4j.simple.SimpleServiceProvider</argLine>
|
||||
<includes>
|
||||
<!-- plexus-паттерн: `**` НЕ матчит ноль каталогов —
|
||||
классы корневого пакета добавлены отдельным паттерном -->
|
||||
<include>ru/pjandro/wordpdf/*Test.java</include>
|
||||
<include>ru/pjandro/wordpdf/**/*Test.java</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>org/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- Чужой код (слитый docx4j) не линтеруется и не измеряется:
|
||||
PMD и JaCoCo — только по ru.pjandro.*. -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>**/org/docx4j/**</exclude>
|
||||
<exclude>**/org/pptx4j/**</exclude>
|
||||
<exclude>**/org/xlsx4j/**</exclude>
|
||||
<exclude>**/org/glox4j/**</exclude>
|
||||
<exclude>**/org/opendope/**</exclude>
|
||||
<exclude>**/org/merlin/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Гейт покрытия ядра: к общему LINE 0.90 (корневой pluginManagement)
|
||||
добавлен BRANCH 0.85 — только для core; у wordpdf-app бранчи ниже
|
||||
порога, общий rule в корне остаётся LINE-only. -->
|
||||
порога, общий rule в корне остаётся LINE-only. Исключения — слитый
|
||||
docx4j: иначе 4 тыс. чужих файлов уронят порог. -->
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>org/docx4j/**</exclude>
|
||||
<exclude>org/pptx4j/**</exclude>
|
||||
<exclude>org/xlsx4j/**</exclude>
|
||||
<exclude>org/glox4j/**</exclude>
|
||||
<exclude>org/opendope/**</exclude>
|
||||
<exclude>org/merlin/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>check</id>
|
||||
@@ -127,4 +416,69 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<!-- Перенесённый upstream-набор тестов docx4j (409 core + 182 export-fo-tests +
|
||||
37 in-module + 7 chart-render + 1 JAXB-RI). Не в гейте по умолчанию:
|
||||
~660 классов × отдельный JVM (требование upstream: Saxon XPath и тесты,
|
||||
мутирующие статические карты) = десятки минут. Пуск:
|
||||
mvn -pl wordpdf-core -am test -Pupstream-tests -->
|
||||
<profile>
|
||||
<id>upstream-tests</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>upstream-docx4j-tests</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>test</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- upstream-набор пишет через logback (несколько
|
||||
классов достают LoggerContext напрямую); JAXP-фабрики —
|
||||
JDK-реализации, как в upstream docx4j.properties
|
||||
(xercesImpl на test-classpath иначе перехватывает
|
||||
DocumentBuilderFactory.newInstance() через
|
||||
META-INF/services, а standalone-Xerces 2.12.2 не
|
||||
знает factory-свойство accessExternalDTD, на котором
|
||||
падает ExtractionConformanceTest) -->
|
||||
<argLine>@{argLine} -Djava.awt.headless=true -Dslf4j.provider=ch.qos.logback.classic.spi.LogbackServiceProvider -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl</argLine>
|
||||
<includes>
|
||||
<!-- `**` не матчит ноль каталогов — root-пакеты отдельными паттернами -->
|
||||
<include>org/docx4j/*Test.java</include>
|
||||
<include>org/docx4j/*Tests.java</include>
|
||||
<include>org/docx4j/**/*Test.java</include>
|
||||
<include>org/docx4j/**/*Tests.java</include>
|
||||
<include>org/pptx4j/*Test.java</include>
|
||||
<include>org/pptx4j/**/*Test.java</include>
|
||||
<include>org/pptx4j/**/*Tests.java</include>
|
||||
<include>org/xlsx4j/*Test.java</include>
|
||||
<include>org/xlsx4j/**/*Test.java</include>
|
||||
<include>org/xlsx4j/**/*Tests.java</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/samples/**</exclude>
|
||||
<exclude>**/AbstractNumberingTest.java</exclude>
|
||||
<!-- читает docx4j.properties из корня classpath — он
|
||||
намеренно не перенесён (менял бы поведение всем
|
||||
тестам модуля, см. план слияния); остальные
|
||||
зависимости от того properties — известно-красные
|
||||
методы, триаж в docs/agent/testing.md (surefire
|
||||
запрещает #method в excludes POM'а) -->
|
||||
<exclude>**/Docx4jPropertiesFoFileTest.java</exclude>
|
||||
</excludes>
|
||||
<forkCount>1</forkCount>
|
||||
<reuseForks>false</reuseForks>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user