Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

}
3 changes: 3 additions & 0 deletions .github/workflows/build_maven_compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_maven_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
6 changes: 3 additions & 3 deletions .github/workflows/deploy_maven_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ 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 <https://github.com/fugerit-org/fj-doc/issues/489>

### 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

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;

@Slf4j
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 );
}
Expand Down
1 change: 0 additions & 1 deletion fj-doc-freemarker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@

<dependencies>

<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker -->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,21 @@ Add this element to *<docHandlerConfig/>* :
<docHandler id="openpdf-html" info="openpdf-html" type="org.fugerit.java.doc.mod.openpdf.ext.HtmlTypeHandler"/>
----

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].
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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]
----
<dependencies>
<dependency>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc-mod-openpdf-next</artifactId>
<version>8.16.0</version>
</dependency>
</dependencies>
----

And building your project with java 21, the transient dependency for link:https://github.com/LibrePDF/OpenPDF/[OpenPDF] will be :

[source,xml]
----
<dependency>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
<version>2.4.0</version>
</dependency>
----

otherwise when building with java 8 :

[source,xml]
----
<dependency>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
<version>1.3.43</version>
</dependency>
----

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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<<<
[#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]
----
<properties>
<freemarker-version>2.3.34</freemarker-version>
</properties>
<dependencies>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>${freemarker-version}</version>
</dependency>
</dependencies>
----

Or the 'fj-doc-mod-fop' module:

[source,xml]
----
<properties>
<fop-version>2.11</fop-version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId>
<version>${fop-version}</version>
</dependency>
</dependencies>
----

[#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]
----
<dependencies>
<dependency>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc-mod-fop</artifactId>
<version>${fj-doc-version}</version>
<exclusions>
<!-- exclusion is not mandatory, as direct dependency has precedence -->
<exclude>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId>
</exclude>
</exclusions>
</dependency>
<!-- here fop version 2.10 will be used instead of standard one -->
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId>
<version>2.10</version>
</dependency>
</dependencies>
----

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]
----
<properties>
<!-- default to version jdk21on -->
<openrtf-version>2.0.0</openrtf-version>
<!-- legacy version -->
<openrtf-version-jdk8ok>1.2.1</openrtf-version-jdk8ok>
</properties>
<profile>
<id>java-jdk8on</id>
<activation>
<jdk>[,21)</jdk>
</activation>
<properties>
<openrtf-version>${openrtf-version-jdk8ok}</openrtf-version>
</properties>
</profile>
----

So, for instance, when importing module :

[source,xml]
----
<dependencies>
<dependency>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc-mod-openrtf-next</artifactId>
<version>8.16.0</version>
</dependency>
</dependencies>
----

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]
* xref:#doc-handler-mod-openpdf-ext[OpenPDF doc handler]
2 changes: 2 additions & 0 deletions fj-doc-guide/src/main/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ 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[]
include::chapters/08_2_dependency-handling.adoc[]

include::chapters/09_doc-playground.adoc[]
1 change: 0 additions & 1 deletion fj-doc-mod-fop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@

<dependencies>

<!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/fop -->
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId>
Expand Down
15 changes: 14 additions & 1 deletion fj-doc-mod-openpdf-ext/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.
Loading
Loading