From fcd97eb5716826b0ce404eae1495395d1e7303d5 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Fri, 10 Jan 2025 14:54:53 -0800 Subject: [PATCH] Implement #1380: use proper `module-info.java` for 3.0 (#1381) --- pom.xml | 55 ++++++++++++++++---- release-notes/VERSION | 1 + src/{moditect => main/java}/module-info.java | 4 ++ src/test/java/module-info.java | 41 +++++++++++++++ 4 files changed, 90 insertions(+), 11 deletions(-) rename src/{moditect => main/java}/module-info.java (77%) create mode 100644 src/test/java/module-info.java diff --git a/pom.xml b/pom.xml index ef8a280058..a60c7f2518 100644 --- a/pom.xml +++ b/pom.xml @@ -108,13 +108,32 @@ tools.jackson.core.*;version=${project.version} com.google.code.maven-replacer-plugin replacer - - org.moditect moditect-maven-plugin + + + add-module-infos + package + + add-module-info + + + true + + src/main/java/module-info.java + + + + + + 17 + @@ -139,6 +158,9 @@ tools.jackson.core.*;version=${project.version} + ch.randelshofer:fastdoubleparser @@ -155,7 +177,10 @@ tools.jackson.core.*;version=${project.version} NOTE: `project.version.underscore' comes from `jackson-base/pom.xml` parent pom --> - tools/jackson/core/internal/shaded/fdp/v${project.version.underscore} + + tools/jackson/core/internal/shaded/fdp META-INF/LICENSE @@ -175,15 +200,15 @@ tools.jackson.core.*;version=${project.version} META-INF/versions/17/ch/randelshofer/fastdoubleparser - META-INF/versions/17/tools/jackson/core/internal/shaded/fdp/v${project.version.underscore} + META-INF/versions/17/tools/jackson/core/internal/shaded/fdp META-INF/versions/21/ch/randelshofer/fastdoubleparser - META-INF/versions/21/tools/jackson/core/internal/shaded/fdp/v${project.version.underscore} + META-INF/versions/21/tools/jackson/core/internal/shaded/fdp META-INF/versions/22/ch/randelshofer/fastdoubleparser - META-INF/versions/22/tools/jackson/core/internal/shaded/fdp/v${project.version.underscore} + META-INF/versions/22/tools/jackson/core/internal/shaded/fdp @@ -193,10 +218,10 @@ tools.jackson.core.*;version=${project.version} de.jjohannes gradle-module-metadata-maven-plugin - - + + ch.randelshofer @@ -214,6 +239,14 @@ tools.jackson.core.*;version=${project.version} true + + + module-info.class + + diff --git a/release-notes/VERSION b/release-notes/VERSION index 5b5b767e37..00bf0c3db9 100644 --- a/release-notes/VERSION +++ b/release-notes/VERSION @@ -49,6 +49,7 @@ JSON library. allocation default implementation (in 3.0) #1364: JSTEP-6: rename `JsonLocation` as `TokenStreamLocation` #1378: Rename `JsonParser.getText()` as `.getString()` [JSTEP-6] +#1380: Change 3.0 to use `module-info.java` directly, remove use of Moditect - Rename `JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT` as `AUTO_CLOSE_CONTENT` - Add `TreeCodec.nullNode()`, `TreeNode.isNull()` methods - Change the way `JsonLocation.NA` is included in exception messages diff --git a/src/moditect/module-info.java b/src/main/java/module-info.java similarity index 77% rename from src/moditect/module-info.java rename to src/main/java/module-info.java index 69eb28ee53..91fa94caaf 100644 --- a/src/moditect/module-info.java +++ b/src/main/java/module-info.java @@ -1,4 +1,8 @@ +// jackson-core main Module descriptor module tools.jackson.core { + // FastDoubleParser shaded but JPMS still requires it to compile? + requires static ch.randelshofer.fastdoubleparser; + exports tools.jackson.core; exports tools.jackson.core.async; exports tools.jackson.core.base; diff --git a/src/test/java/module-info.java b/src/test/java/module-info.java new file mode 100644 index 0000000000..6c3f5d3ea1 --- /dev/null +++ b/src/test/java/module-info.java @@ -0,0 +1,41 @@ +// jackson-core test Module descriptor: contains most if not all main +// plus some test dependencies +module tools.jackson.core { + // Additional test lib/framework dependencies + requires org.assertj.core; + requires org.junit.jupiter.api; + requires org.junit.jupiter.params; + + // FastDoubleParser shaded but JPMS still requires it to compile? + requires static ch.randelshofer.fastdoubleparser; + + // Main exports need to switch to "opens" for testing + opens tools.jackson.core; + opens tools.jackson.core.async; + opens tools.jackson.core.base; + opens tools.jackson.core.exc; + opens tools.jackson.core.filter; + opens tools.jackson.core.io; + opens tools.jackson.core.json; + opens tools.jackson.core.json.async; + opens tools.jackson.core.sym; + opens tools.jackson.core.tree; + opens tools.jackson.core.type; + opens tools.jackson.core.util; + + // Additional test opens (not exported by main) + + opens tools.jackson.core.base64; + opens tools.jackson.core.constraints; + opens tools.jackson.core.dos; + opens tools.jackson.core.fuzz; + opens tools.jackson.core.io.schubfach; + opens tools.jackson.core.jsonptr; + opens tools.jackson.core.read; + opens tools.jackson.core.read.loc; + opens tools.jackson.core.testutil.failure; + opens tools.jackson.core.tofix; + opens tools.jackson.core.tofix.async; + opens tools.jackson.core.write; + +}