From 9a6db3eee56204e9515c630b222446e69b25b752 Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Thu, 21 Aug 2025 23:13:27 +0200 Subject: [PATCH 01/11] feat(dependency)!: jdk21 and legacy version handling for OpenRTF #489 --- .../base/feature/TableCheckIntegrityTest.java | 4 +- fj-doc-mod-openrtf-ext/README.md | 13 ++- fj-doc-mod-openrtf-ext/pom.xml | 90 +++++++++++++++---- .../mod/openrtf/ext/TestOpenRTFVersion.java | 35 ++++++++ 4 files changed, 122 insertions(+), 20 deletions(-) create mode 100644 fj-doc-mod-openrtf-ext/src/test/java/test/org/fugerit/java/doc/mod/openrtf/ext/TestOpenRTFVersion.java diff --git a/fj-doc-base/src/test/java/test/org/fugerit/java/doc/base/feature/TableCheckIntegrityTest.java b/fj-doc-base/src/test/java/test/org/fugerit/java/doc/base/feature/TableCheckIntegrityTest.java index 815757a79..53fe06ab6 100644 --- a/fj-doc-base/src/test/java/test/org/fugerit/java/doc/base/feature/TableCheckIntegrityTest.java +++ b/fj-doc-base/src/test/java/test/org/fugerit/java/doc/base/feature/TableCheckIntegrityTest.java @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.LinkedHashMap; import java.util.Map; -import java.util.Properties; @Slf4j class TableCheckIntegrityTest { @@ -31,8 +30,7 @@ class TableCheckIntegrityTest { private DocBase readDocBase( String fullCLPath ) { try (Reader reader = new InputStreamReader( ClassHelper.loadFromDefaultClassLoader( fullCLPath ) ) ) { DocFacadeSource docFacadeSource = DocFacadeSource.getInstance(); - DocBase docBase = docFacadeSource.parseRE( reader, DocFacadeSource.SOURCE_TYPE_XML, FeatureConfig.DEFAULT ); - return docBase; + return docFacadeSource.parseRE( reader, DocFacadeSource.SOURCE_TYPE_XML, FeatureConfig.DEFAULT ); } catch (IOException e) { throw ConfigRuntimeException.convertEx( e ); } diff --git a/fj-doc-mod-openrtf-ext/README.md b/fj-doc-mod-openrtf-ext/README.md index 4b72a7d1d..73d435ee5 100644 --- a/fj-doc-mod-openrtf-ext/README.md +++ b/fj-doc-mod-openrtf-ext/README.md @@ -1,6 +1,6 @@ # Fugerit Document Generation Framework (fj-doc) -## Openrtf Renderer (rtf)(fj-doc-mod-openrtf-ext) +## OpenRTF Renderer (rtf)(fj-doc-mod-openrtf-ext) [back to fj-doc index](../README.md) @@ -29,3 +29,14 @@ Depends on renderer : fj-doc-mod-openpdf-ext ``` + +## OpenRTF version compatibility matrix + +Starting with version [2.0.0](https://github.com/LibrePDF/OpenRTF/releases/tag/2.0.0) OpenRTF moved to Java 21. + +| OpenRTF | Java | Notes | +|---------|------|------------------------------------------------------------------------| +| 1.x | 8+ | latest OpenRTF version is 1.2.1 | +| 2.x | 21+ | upgraded [OpenPDF](https://github.com/LibrePDF/OpenPDF) dependency too | + + diff --git a/fj-doc-mod-openrtf-ext/pom.xml b/fj-doc-mod-openrtf-ext/pom.xml index a51029c5d..fb4e7e961 100644 --- a/fj-doc-mod-openrtf-ext/pom.xml +++ b/fj-doc-mod-openrtf-ext/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 fj-doc-mod-openrtf-ext @@ -14,7 +14,10 @@ Renderer for RTF format, based on https://github.com/LibrePDF/OpenRTF - 1.2.1 + + 2.0.0 + + 1.2.1 @@ -24,30 +27,29 @@ repo - - + - com.github.librepdf - openrtf - ${openrtf-version} - + com.github.librepdf + openrtf + ${openrtf-version} + org.fugerit.java fj-core - - + + org.fugerit.java fj-doc-base - - + + org.fugerit.java fj-doc-mod-openpdf-ext - - + + org.fugerit.java fj-doc-freemarker @@ -62,11 +64,67 @@ + + + + java-jdk8on + + [,21) + + + ${openrtf-version-jdk8ok} + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + true + + + + + + + + + coverage + + + + org.apache.maven.plugins + maven-antrun-plugin + + + run-multi-profiles + verify + + + + + + + + + + run + + + + + + + + + + https://www.fugerit.org Fugerit - + https://www.fugerit.org/perm/venus/ - + diff --git a/fj-doc-mod-openrtf-ext/src/test/java/test/org/fugerit/java/doc/mod/openrtf/ext/TestOpenRTFVersion.java b/fj-doc-mod-openrtf-ext/src/test/java/test/org/fugerit/java/doc/mod/openrtf/ext/TestOpenRTFVersion.java new file mode 100644 index 000000000..caef53990 --- /dev/null +++ b/fj-doc-mod-openrtf-ext/src/test/java/test/org/fugerit/java/doc/mod/openrtf/ext/TestOpenRTFVersion.java @@ -0,0 +1,35 @@ +package test.org.fugerit.java.doc.mod.openrtf.ext; + +import lombok.extern.slf4j.Slf4j;import org.fugerit.java.core.lang.helpers.ClassHelper; +import org.fugerit.java.core.util.mvn.MavenProps; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledForJreRange; +import org.junit.jupiter.api.condition.DisabledIfSystemProperty; +import org.junit.jupiter.api.condition.DisabledOnJre; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; + +@Slf4j +class TestOpenRTFVersion { + + private static final String SYS_PROP = "openrtf.jdk8.dependency.check"; + + private String getVersion() { + String version = MavenProps.getProperty( "com.github.librepdf", "openrtf", "version" ); + log.info( "using version {}, check:{}={}", version, SYS_PROP, System.getProperty( SYS_PROP ) ); + return version; + } + + @Test + @EnabledIfSystemProperty( named = SYS_PROP, matches = "true" ) + void testJdk8on() { + Assertions.assertTrue( this.getVersion().startsWith( "1." ) ); + } + + @Test + @DisabledIfSystemProperty( named = SYS_PROP, matches = "true" ) + void testJdk21on() { + Assertions.assertTrue( this.getVersion().startsWith( "2." ) ); + } + +} From fb06be37523c52da68105e20b509cfd6d79793a6 Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Thu, 21 Aug 2025 23:34:13 +0200 Subject: [PATCH 02/11] docs(dependency): dependency handling guide #489 --- .../chapters/06_6_mod-openrtf-ext.adoc | 16 +++ .../chapters/08_2_dependency-handling.adoc | 123 ++++++++++++++++++ .../src/main/docs/asciidoc/index.adoc | 1 + 3 files changed, 140 insertions(+) create mode 100644 fj-doc-guide/src/main/docs/asciidoc/chapters/08_2_dependency-handling.adoc diff --git a/fj-doc-guide/src/main/docs/asciidoc/chapters/06_6_mod-openrtf-ext.adoc b/fj-doc-guide/src/main/docs/asciidoc/chapters/06_6_mod-openrtf-ext.adoc index 9437094fc..43c8fc422 100644 --- a/fj-doc-guide/src/main/docs/asciidoc/chapters/06_6_mod-openrtf-ext.adoc +++ b/fj-doc-guide/src/main/docs/asciidoc/chapters/06_6_mod-openrtf-ext.adoc @@ -35,3 +35,19 @@ For a demo of this doc handler usage you can refer to the link:https://github.co More elements specific to fixed size formats, like RTF, are available link:https://venusdocs.fugerit.org/docs/html/doc_meta_info.html#meta_fixed[here]. +[#doc-handler-mod-openrtf-ext-java-version] +==== Java version compatibility + +NOTE: OpenRTF used to be compatible with java 8+, but starting with version 2.0.0 they moved to java 21+. + +Starting with Fugerit Venus Doc version 8.16.0 the xref:#doc-maven-dependency-handling-java-version[Dependencies handling is based on java runtime version], here is the compatibility matrix : + +[cols="2*", options="header"] +|==================================================================================================================================================================================== +| java version | OpenRTF version + +| 21+ +| 2.0.0+ + +| 8 / 21 +| 1.2.1 diff --git a/fj-doc-guide/src/main/docs/asciidoc/chapters/08_2_dependency-handling.adoc b/fj-doc-guide/src/main/docs/asciidoc/chapters/08_2_dependency-handling.adoc new file mode 100644 index 000000000..571939d7b --- /dev/null +++ b/fj-doc-guide/src/main/docs/asciidoc/chapters/08_2_dependency-handling.adoc @@ -0,0 +1,123 @@ +<<< +[#doc-maven-dependency-handling] +=== Maven dependency handling + +This chapter describes Venus Fugerit Doc dependency handling. + +[#doc-maven-dependency-handling-transient] +==== Transient dependencies + +Each submodule has its own transient dependencies. +for instance, the 'fj-doc-freemarker' module will add the dependency : + +[source,xml] +---- + + 2.3.34 + + + + org.freemarker + freemarker + ${freemarker-version} + + +---- + +Or the 'fj-doc-mod-fop' module: + +[source,xml] +---- + + 2.11 + + + + org.apache.xmlgraphics + fop + ${fop-version} + + +---- + +[#doc-maven-dependency-handling-override] +==== Override dependencies + +It is always possible, as usual with [Maven](https://maven.apache.org/), to override the standard dependency. + +For instance, in your code : + +[source,xml] +---- + + + org.fugerit.java + fj-doc-mod-fop + ${fj-doc-version} + + + + org.apache.xmlgraphics + fop + + + + + + org.apache.xmlgraphics + fop + 2.10 + + +---- + +WARNING: be careful as something may not work as expected when overriding default dependency version. + +[#doc-maven-dependency-handling-java-version] +==== Dependencies based on java version + +Starting with Venus Fugerit Doc version 8.16.0 a new version dependency is introduced for some modules. + +This project generally works with java 8+, but some submodules have moved one to a more recent jave version. + +This is totally transparent to the importing project, and is achieved using maven profiles +activation on a specific runtime java version, for instance : + +[source,xml] +---- + + + 2.0.0 + + 1.2.1 + + + java-jdk8on + + [,21) + + + ${openrtf-version-jdk8ok} + + +---- + +So, for instance, when importing module : + +[source,xml] +---- + + + org.fugerit.java + fj-doc-mod-openrtf-next + 8.16.0 + + +---- + +If you build your project with java version 21+, OpenRTF 2.0.0 will be imported (which requires java 21+). +Otherwise, when using a lower version of java, OpenRTF 1.2.1 will be imported (compatible with java 8+ but no more maintained). + +here are the submodules supporting version based on java runtime version : + +* xref:#doc-handler-mod-openrtf-ext[OpenRTF doc handler] \ No newline at end of file diff --git a/fj-doc-guide/src/main/docs/asciidoc/index.adoc b/fj-doc-guide/src/main/docs/asciidoc/index.adoc index fc74799ae..c7e0a3e16 100644 --- a/fj-doc-guide/src/main/docs/asciidoc/index.adoc +++ b/fj-doc-guide/src/main/docs/asciidoc/index.adoc @@ -52,5 +52,6 @@ include::chapters/07_006_doc-faq-endline-fop.adoc[] include::chapters/08_doc-optmization.adoc[] include::chapters/08_1_eager-startup.adoc[] +include::chapters/08_2_dependency-handling.adoc[] include::chapters/09_doc-playground.adoc[] From 78ce4ad5b1e892c10dfefa7cb42a7eb0033e6558 Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Thu, 21 Aug 2025 23:35:28 +0200 Subject: [PATCH 03/11] chore: cleaning code #489 --- fj-doc-freemarker/pom.xml | 1 - fj-doc-mod-fop/pom.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/fj-doc-freemarker/pom.xml b/fj-doc-freemarker/pom.xml index 073b03c5a..d0650b37e 100644 --- a/fj-doc-freemarker/pom.xml +++ b/fj-doc-freemarker/pom.xml @@ -73,7 +73,6 @@ - org.freemarker freemarker diff --git a/fj-doc-mod-fop/pom.xml b/fj-doc-mod-fop/pom.xml index e0e0aba63..10736a87a 100644 --- a/fj-doc-mod-fop/pom.xml +++ b/fj-doc-mod-fop/pom.xml @@ -72,7 +72,6 @@ - org.apache.xmlgraphics fop From 150717dad287994400217464bf94e6f19c70b86d Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Fri, 22 Aug 2025 00:21:00 +0200 Subject: [PATCH 04/11] chore: setup manual run for compatibility workflow --- .github/workflows/build_maven_compatibility.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_maven_compatibility.yml b/.github/workflows/build_maven_compatibility.yml index 1c62d3894..ea3934f91 100644 --- a/.github/workflows/build_maven_compatibility.yml +++ b/.github/workflows/build_maven_compatibility.yml @@ -13,6 +13,9 @@ on: branches: - branch-compatibility + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + # only allow one workflow at time on the give activation concurrency: group: ${{ github.workflow }} From 966366f90dbfe6e3c63db7ad28b7170cc16d8f69 Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Fri, 22 Aug 2025 00:40:46 +0200 Subject: [PATCH 05/11] chore: maven deploy workflow switched from java 17 (corretto) to java 21 (GraalVM) #489 --- .github/workflows/deploy_maven_package.yml | 6 +++--- CHANGELOG.md | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_maven_package.yml b/.github/workflows/deploy_maven_package.yml index 7bc08f78a..2b7b09db6 100644 --- a/.github/workflows/deploy_maven_package.yml +++ b/.github/workflows/deploy_maven_package.yml @@ -23,11 +23,11 @@ jobs: steps: - uses: actions/checkout@main - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@main with: - java-version: '17' - distribution: 'corretto' + java-version: '21' + distribution: 'graalvm' cache: maven server-id: ${{ vars.MAVEN_SERVERID }} server-username: MAVEN_USERNAME diff --git a/CHANGELOG.md b/CHANGELOG.md index 1645fb45e..edf65d7d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- maven deploy workflow switched from java 17 (corretto) to java 21 (GraalVM) + ## [8.15.1] - 2025-08-21 ### Changed From 77cb6f981ecbbae035a4415804b8ccb2b5aca50e Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Fri, 22 Aug 2025 00:51:17 +0200 Subject: [PATCH 06/11] Setup devcontainer for java 21 --- .devcontainer/devcontainer.json | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 39bbd2681..5ca51dfe4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,13 @@ { - "image": "mcr.microsoft.com/devcontainers/universal:2", - "features": {} + "image": "mcr.microsoft.com/devcontainers/java:1-21", + + "features": { + "ghcr.io/devcontainers/features/java:1": { + "version": "none", + "installMaven": "true", + "mavenVersion": "3.9.9", + "installGradle": "false" + } + } + } From 5b6598a1148b18641c53967b9ea7fc13c742502d Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Fri, 22 Aug 2025 01:13:51 +0200 Subject: [PATCH 07/11] feat(dependency)!: jdk21 and legacy version handling for OpenPDF #489 --- .../chapters/06_5_mod-openpdf-ext.adoc | 19 +- .../chapters/08_2_dependency-handling.adoc | 3 +- fj-doc-mod-openpdf-ext/README.md | 15 +- fj-doc-mod-openpdf-ext/pom.xml | 189 ++++++++++++------ .../mod/openpdf/ext/TestOpenPDFVersion.java | 33 +++ 5 files changed, 191 insertions(+), 68 deletions(-) create mode 100644 fj-doc-mod-openpdf-ext/src/test/java/test/org/fugerit/java/doc/mod/openpdf/ext/TestOpenPDFVersion.java diff --git a/fj-doc-guide/src/main/docs/asciidoc/chapters/06_5_mod-openpdf-ext.adoc b/fj-doc-guide/src/main/docs/asciidoc/chapters/06_5_mod-openpdf-ext.adoc index 2994c56f4..6aaf13e9b 100644 --- a/fj-doc-guide/src/main/docs/asciidoc/chapters/06_5_mod-openpdf-ext.adoc +++ b/fj-doc-guide/src/main/docs/asciidoc/chapters/06_5_mod-openpdf-ext.adoc @@ -87,4 +87,21 @@ Add this element to ** : ---- -For a demo of this doc handler usage you can refer to the link:https://github.com/fugerit-org/fj-doc-quarkus-tutorial[fj-doc-quarkus-tutorial full example] or link:https://github.com/fugerit-org/fj-doc-quarkus-tutorial/tree/base-freemarker-modopenpdfext[fj-doc-quarkus-tutorial openpdf ext example]. \ No newline at end of file +For a demo of this doc handler usage you can refer to the link:https://github.com/fugerit-org/fj-doc-quarkus-tutorial[fj-doc-quarkus-tutorial full example] or link:https://github.com/fugerit-org/fj-doc-quarkus-tutorial/tree/base-freemarker-modopenpdfext[fj-doc-quarkus-tutorial openpdf ext example]. + +[#doc-handler-mod-openrpdf-ext-java-version] +==== Java version compatibility + +NOTE: OpenPDF used to be compatible with java 8+, but starting with version 2.4.0 they moved to java 21+. + +Starting with Fugerit Venus Doc version 8.16.0 the xref:#doc-maven-dependency-handling-java-version[Dependencies handling is based on java runtime version], here is the compatibility matrix : + +[cols="2*", options="header"] +|==================================================================================================================================================================================== +| java version | OpenRTF version + +| 21+ +| 2.4.0+ + +| 8 / 21 +| 1.3.43 diff --git a/fj-doc-guide/src/main/docs/asciidoc/chapters/08_2_dependency-handling.adoc b/fj-doc-guide/src/main/docs/asciidoc/chapters/08_2_dependency-handling.adoc index 571939d7b..7f8c81fe8 100644 --- a/fj-doc-guide/src/main/docs/asciidoc/chapters/08_2_dependency-handling.adoc +++ b/fj-doc-guide/src/main/docs/asciidoc/chapters/08_2_dependency-handling.adoc @@ -120,4 +120,5 @@ Otherwise, when using a lower version of java, OpenRTF 1.2.1 will be imported (c here are the submodules supporting version based on java runtime version : -* xref:#doc-handler-mod-openrtf-ext[OpenRTF doc handler] \ No newline at end of file +* xref:#doc-handler-mod-openrtf-ext[OpenRTF doc handler] +* xref:#doc-handler-mod-openpdf-ext[OpenPDF doc handler] \ No newline at end of file diff --git a/fj-doc-mod-openpdf-ext/README.md b/fj-doc-mod-openpdf-ext/README.md index e0667abea..6abfc2060 100644 --- a/fj-doc-mod-openpdf-ext/README.md +++ b/fj-doc-mod-openpdf-ext/README.md @@ -19,4 +19,17 @@ Disabled, native support will be added in a future release. openpdf-ext native s *Quickstart* : Basically this is only a type handler, see core library [fj-doc-base](../fj-doc-base/README.md). -NOTE: If you have any special need you can open a pull request or create your own handler based on this. \ No newline at end of file +NOTE: If you have any special need you can open a pull request or create your own handler based on this. + +## OpenRTF version compatibility matrix + +Starting with version [2.2.0](https://github.com/LibrePDF/OpenPDF/releases/tag/2.2.0) OpenRTF moved to Java 21. + +| OpenPDF | Java | Notes | +|---------|------|----------------------------------| +| 1.3+ | 8+ | latest OpenRTF version is 1.3.43 | +| 1.4+ | 11+ | latest OpenRTF version is 1.4.2 | +| 2.0+ | 17+ | latest OpenRTF version is 2.0.5 | +| 2.2+ | 21+ | latest OpenRTF version is 2.4.0 | + +NOTE: with release [3.0.0](https://github.com/LibrePDF/OpenPDF/releases/tag/3.0.0) the original IText package has been dropped. \ No newline at end of file diff --git a/fj-doc-mod-openpdf-ext/pom.xml b/fj-doc-mod-openpdf-ext/pom.xml index b8f1903cc..6244b95c9 100644 --- a/fj-doc-mod-openpdf-ext/pom.xml +++ b/fj-doc-mod-openpdf-ext/pom.xml @@ -1,67 +1,126 @@ - 4.0.0 - - fj-doc-mod-openpdf-ext - - - org.fugerit.java - fj-doc - 8.15.2-SNAPSHOT - - - fj-doc-mod-openpdf-ext - Renderer for PDF format, based on https://github.com/LibrePDF/OpenPDF - - - 1.3.43 - - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - - com.github.librepdf - openpdf - ${openpdf-version} - - - - org.fugerit.java - fj-core - - - - org.fugerit.java - fj-doc-base - - - - org.fugerit.java - fj-doc-freemarker - test - - - - org.junit.jupiter - junit-jupiter-api - test - - - - - - https://www.fugerit.org - Fugerit - - - https://www.fugerit.org/perm/venus/ - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + fj-doc-mod-openpdf-ext + + + org.fugerit.java + fj-doc + 8.15.2-SNAPSHOT + + + fj-doc-mod-openpdf-ext + Renderer for PDF format, based on https://github.com/LibrePDF/OpenPDF + + + + 2.4.0 + + 1.3.43 + + + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.github.librepdf + openpdf + ${openpdf-version} + + + + org.fugerit.java + fj-core + + + + org.fugerit.java + fj-doc-base + + + + org.fugerit.java + fj-doc-freemarker + test + + + + org.junit.jupiter + junit-jupiter-api + test + + + + + + + + java-jdk8on + + [,21) + + + ${openpdf-version-jdk8ok} + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + true + + + + + + + + + coverage + + + + org.apache.maven.plugins + maven-antrun-plugin + + + run-multi-profiles + verify + + + + + + + + + + run + + + + + + + + + + + + https://www.fugerit.org + Fugerit + + + https://www.fugerit.org/perm/venus/ + diff --git a/fj-doc-mod-openpdf-ext/src/test/java/test/org/fugerit/java/doc/mod/openpdf/ext/TestOpenPDFVersion.java b/fj-doc-mod-openpdf-ext/src/test/java/test/org/fugerit/java/doc/mod/openpdf/ext/TestOpenPDFVersion.java new file mode 100644 index 000000000..cdd9c14a4 --- /dev/null +++ b/fj-doc-mod-openpdf-ext/src/test/java/test/org/fugerit/java/doc/mod/openpdf/ext/TestOpenPDFVersion.java @@ -0,0 +1,33 @@ +package test.org.fugerit.java.doc.mod.openpdf.ext; + +import lombok.extern.slf4j.Slf4j; +import org.fugerit.java.core.util.mvn.MavenProps; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfSystemProperty; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; + +@Slf4j +class TestOpenPDFVersion { + + private static final String SYS_PROP = "openpdf.jdk8.dependency.check"; + + private String getVersion() { + String version = MavenProps.getProperty( "com.github.librepdf", "openpdf", "version" ); + log.info( "using version {}, check:{}={}", version, SYS_PROP, System.getProperty( SYS_PROP ) ); + return version; + } + + @Test + @EnabledIfSystemProperty( named = SYS_PROP, matches = "true" ) + void testJdk8on() { + Assertions.assertTrue( this.getVersion().startsWith( "1." ) ); + } + + @Test + @DisabledIfSystemProperty( named = SYS_PROP, matches = "true" ) + void testJdk21on() { + Assertions.assertTrue( this.getVersion().startsWith( "2." ) ); + } + +} From 1cf75608e6f35031179e5c7bc1c263ba4c4effb6 Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Fri, 22 Aug 2025 01:16:22 +0200 Subject: [PATCH 08/11] docs: changelog and release notes 8.16.0 --- CHANGELOG.md | 4 ++++ .../src/main/docs/asciidoc/chapters/00_2_release_notes.adoc | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index edf65d7d7..2d45d373e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- fj-doc-mod-openpdf-ext / fj-doc-mod-openrtf-ext, multiple java version dependency handling + ### Changed - maven deploy workflow switched from java 17 (corretto) to java 21 (GraalVM) diff --git a/fj-doc-guide/src/main/docs/asciidoc/chapters/00_2_release_notes.adoc b/fj-doc-guide/src/main/docs/asciidoc/chapters/00_2_release_notes.adoc index 5a6062792..79611bdd1 100644 --- a/fj-doc-guide/src/main/docs/asciidoc/chapters/00_2_release_notes.adoc +++ b/fj-doc-guide/src/main/docs/asciidoc/chapters/00_2_release_notes.adoc @@ -3,6 +3,11 @@ Whereas the link:https://github.com/fugerit-org/fj-doc/blob/main/CHANGELOG.md[CHANGELOG] is a detailed list of modifications to project, the release notes just refer to the most important changes. +[#doc-release-notes-8-16-0] +==== Version 8.16.0 [2025-08-22] + +- [fj-doc-mod-openpdf-ext / fj-doc-mod-openrtf-ext] multiple java version dependency handling link:https://github.com/fugerit-org/fj-doc/issues/489[#489] + [#doc-release-notes-8-15-1] ==== Version 8.15.1 [2025-08-21] From 4d4d11255625b6322601d8ad8b6710f9c694f90b Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Fri, 22 Aug 2025 01:23:15 +0200 Subject: [PATCH 09/11] docs: FAQ for dependency handling --- ...a-runtime-version-dependency-handling.adoc | 44 +++++++++++++++++++ .../src/main/docs/asciidoc/index.adoc | 1 + 2 files changed, 45 insertions(+) create mode 100644 fj-doc-guide/src/main/docs/asciidoc/chapters/07_007_java-runtime-version-dependency-handling.adoc diff --git a/fj-doc-guide/src/main/docs/asciidoc/chapters/07_007_java-runtime-version-dependency-handling.adoc b/fj-doc-guide/src/main/docs/asciidoc/chapters/07_007_java-runtime-version-dependency-handling.adoc new file mode 100644 index 000000000..e39f4aacb --- /dev/null +++ b/fj-doc-guide/src/main/docs/asciidoc/chapters/07_007_java-runtime-version-dependency-handling.adoc @@ -0,0 +1,44 @@ + +[#doc-faq-java-runtime-version-dependency-handling] +=== Handling dependency based on java runtime version + +Starting with Fugerit Venus Doc version 8.16.0 xref:#doc-maven-dependency-handling-java-version[Dependencies based on java version] has been introduced. + +For instance when importing : + +[source,xml] +---- + + + org.fugerit.java + fj-doc-mod-openpdf-next + 8.16.0 + + +---- + +And building your project with java 21, the transient dependency for link:https://github.com/LibrePDF/OpenPDF/[OpenPDF] will be : + +[source,xml] +---- + + com.github.librepdf + openpdf + 2.4.0 + +---- + +otherwise when building with java 8 : + +[source,xml] +---- + + com.github.librepdf + openpdf + 1.3.43 + +---- + +So dependency management will do its best to include the most recent compatible version of the dependency. + +NOTE: compatibility is tested by running unit test on both version. \ No newline at end of file diff --git a/fj-doc-guide/src/main/docs/asciidoc/index.adoc b/fj-doc-guide/src/main/docs/asciidoc/index.adoc index c7e0a3e16..fb7e165fb 100644 --- a/fj-doc-guide/src/main/docs/asciidoc/index.adoc +++ b/fj-doc-guide/src/main/docs/asciidoc/index.adoc @@ -49,6 +49,7 @@ include::chapters/07_003_doc-faq-clean-source.adoc[] include::chapters/07_004_doc-faq-resize-xls.adoc[] include::chapters/07_005_doc-faq-kotlin-step.adoc[] include::chapters/07_006_doc-faq-endline-fop.adoc[] +include::chapters/07_007_java-runtime-version-dependency-handling.adoc[] include::chapters/08_doc-optmization.adoc[] include::chapters/08_1_eager-startup.adoc[] From da59dea7ed39e482ae411b2314a6136f8581cfea Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Fri, 22 Aug 2025 01:27:11 +0200 Subject: [PATCH 10/11] chore: maven build and scan workflow switched from java 17 (corretto) to java 21 (GraalVM) --- .github/workflows/build_maven_package.yml | 2 ++ CHANGELOG.md | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/build_maven_package.yml b/.github/workflows/build_maven_package.yml index 755b9ded3..e4c8a8316 100644 --- a/.github/workflows/build_maven_package.yml +++ b/.github/workflows/build_maven_package.yml @@ -39,6 +39,8 @@ jobs: #snyk-args: --file=fj-doc-playground-quarkus/Dockerfile #snyk-dockercontext: fj-doc-playground-quarkus #snyk-dockertag: fj-doc-playground-quarkus + java-version: 21 + java-distribution: 'graalvm' maven-additional-profiles: ',buildreact' disable-maven-dependency-submission: ${{ vars.DISABLE_MAVEN_DEPENDENCY_SUBMISSION }} disable-upload-sarif: ${{ vars.DISABLE_UPLOAD_SARIF }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d45d373e..b1e67569d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - maven deploy workflow switched from java 17 (corretto) to java 21 (GraalVM) +- maven build and scan workflow switched from java 17 (corretto) to java 21 (GraalVM) ## [8.15.1] - 2025-08-21 From 33ab4e07fd56cc6fe721dba3c79dd707a0af7243 Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Fri, 22 Aug 2025 01:32:24 +0200 Subject: [PATCH 11/11] chore: typo --- fj-doc-mod-openrtf-ext/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fj-doc-mod-openrtf-ext/README.md b/fj-doc-mod-openrtf-ext/README.md index 73d435ee5..405366226 100644 --- a/fj-doc-mod-openrtf-ext/README.md +++ b/fj-doc-mod-openrtf-ext/README.md @@ -37,6 +37,4 @@ Starting with version [2.0.0](https://github.com/LibrePDF/OpenRTF/releases/tag/2 | OpenRTF | Java | Notes | |---------|------|------------------------------------------------------------------------| | 1.x | 8+ | latest OpenRTF version is 1.2.1 | -| 2.x | 21+ | upgraded [OpenPDF](https://github.com/LibrePDF/OpenPDF) dependency too | - - +| 2.x | 21+ | upgraded [OpenPDF](https://github.com/LibrePDF/OpenPDF) dependency too | \ No newline at end of file