From 04016d18161dba21322124541886e009ec81cf12 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Wed, 22 Jan 2025 20:45:35 -0800 Subject: [PATCH] Fix #206: use proper `module-info.java` for building (#207) --- base/pom.xml | 20 +++++------ base/src/main/java/module-info.java | 14 ++++++++ base/src/moditect/module-info.java | 22 ------------ base/src/test/java/module-info.java | 18 ++++++++++ cbor/pom.xml | 8 ++--- cbor/src/main/java/module-info.java | 21 +++++++++++ .../jaxrs/cbor/CBORMapperConfigurator.java | 1 + cbor/src/moditect/module-info.java | 29 --------------- cbor/src/test/java/module-info.java | 24 +++++++++++++ datatypes/pom.xml | 14 ++++---- datatypes/src/main/java/module-info.java | 12 +++++++ datatypes/src/moditect/module-info.java | 21 ----------- datatypes/src/test/java/module-info.java | 17 +++++++++ json/pom.xml | 30 +++------------- json/src/main/java/module-info.java | 19 ++++++++++ json/src/moditect/module-info.java | 36 ------------------- json/src/test/java/module-info.java | 25 +++++++++++++ .../resteasy/RestEasyProviderLoadingTest.java | 20 ----------- pom.xml | 27 +++++--------- release-notes/VERSION | 1 + smile/pom.xml | 7 +--- smile/src/main/java/module-info.java | 21 +++++++++++ smile/src/moditect/module-info.java | 29 --------------- smile/src/test/java/module-info.java | 24 +++++++++++++ xml/pom.xml | 7 +--- xml/src/main/java/module-info.java | 21 +++++++++++ xml/src/moditect/module-info.java | 29 --------------- xml/src/test/java/module-info.java | 24 +++++++++++++ yaml/pom.xml | 7 +--- yaml/src/main/java/module-info.java | 21 +++++++++++ yaml/src/moditect/module-info.java | 29 --------------- yaml/src/test/java/module-info.java | 30 ++++++++++++++++ .../jaxrs/yaml/dw/SimpleEndpointTestBase.java | 30 +++++++++------- 33 files changed, 346 insertions(+), 312 deletions(-) create mode 100644 base/src/main/java/module-info.java delete mode 100644 base/src/moditect/module-info.java create mode 100644 base/src/test/java/module-info.java create mode 100644 cbor/src/main/java/module-info.java delete mode 100644 cbor/src/moditect/module-info.java create mode 100644 cbor/src/test/java/module-info.java create mode 100644 datatypes/src/main/java/module-info.java delete mode 100644 datatypes/src/moditect/module-info.java create mode 100644 datatypes/src/test/java/module-info.java create mode 100644 json/src/main/java/module-info.java delete mode 100644 json/src/moditect/module-info.java create mode 100644 json/src/test/java/module-info.java delete mode 100644 json/src/test/java/tools/jackson/jaxrs/json/resteasy/RestEasyProviderLoadingTest.java create mode 100644 smile/src/main/java/module-info.java delete mode 100644 smile/src/moditect/module-info.java create mode 100644 smile/src/test/java/module-info.java create mode 100644 xml/src/main/java/module-info.java delete mode 100644 xml/src/moditect/module-info.java create mode 100644 xml/src/test/java/module-info.java create mode 100644 yaml/src/main/java/module-info.java delete mode 100644 yaml/src/moditect/module-info.java create mode 100644 yaml/src/test/java/module-info.java diff --git a/base/pom.xml b/base/pom.xml index cf153e83..d264efc0 100644 --- a/base/pom.xml +++ b/base/pom.xml @@ -13,7 +13,7 @@ jackson-jaxrs-base Jackson-JAXRS-base - bundle + jar Pile of code that is shared by all Jackson-based JAX-RS providers. @@ -42,16 +42,14 @@ ${project.groupId}.annotation.*;version=${project.version} tools.jackson.core jackson-databind - - - - - - org.moditect - moditect-maven-plugin - + + + jakarta.xml.bind + jakarta.xml.bind-api + provided + - - + + diff --git a/base/src/main/java/module-info.java b/base/src/main/java/module-info.java new file mode 100644 index 00000000..a1f8e77e --- /dev/null +++ b/base/src/main/java/module-info.java @@ -0,0 +1,14 @@ +// JAX-RS Base module-info for Main artifact +module tools.jackson.jaxrs.base +{ + requires com.fasterxml.jackson.annotation; + requires tools.jackson.core; + requires tools.jackson.databind; + + requires java.ws.rs; + + exports tools.jackson.jaxrs.annotation; + exports tools.jackson.jaxrs.base; + exports tools.jackson.jaxrs.cfg; + exports tools.jackson.jaxrs.util; +} diff --git a/base/src/moditect/module-info.java b/base/src/moditect/module-info.java deleted file mode 100644 index 58873470..00000000 --- a/base/src/moditect/module-info.java +++ /dev/null @@ -1,22 +0,0 @@ -module tools.jackson.jaxrs.base { - exports tools.jackson.jaxrs.annotation; - exports tools.jackson.jaxrs.base; - exports tools.jackson.jaxrs.cfg; - exports tools.jackson.jaxrs.util; - - requires com.fasterxml.jackson.annotation; - requires tools.jackson.core; - requires tools.jackson.databind; - - //Allow multiple implementations of ws.rs - //oracle location - requires static javax.ws.rs.api; - //oracle location - requires static java.ws.rs; - //jakarta initial location - 2.x - requires static javax.ws.rs; - //jakarta 3.x final location - https://github.com/jboss/jboss-jakarta-jaxrs-api_spec - requires static jakarta.ws.rs; - //jakarta 3.x final location - https://github.com/eclipse-ee4j/jaxrs-api - requires static jakarta.ws.rs.api; -} diff --git a/base/src/test/java/module-info.java b/base/src/test/java/module-info.java new file mode 100644 index 00000000..a5c7fcd0 --- /dev/null +++ b/base/src/test/java/module-info.java @@ -0,0 +1,18 @@ +// JAX-RS Base module-info for (unit) Tests +module tools.jackson.jaxrs.base +{ + // Since we are not split from Main artifact, will not + // need to depend on Main artifact -- but need its dependencies + + requires com.fasterxml.jackson.annotation; + requires tools.jackson.core; + requires transitive tools.jackson.databind; + + // Additional test lib/framework dependencies + requires junit; // JUnit 4 + + // Further, need to open up test packages for JUnit et al + + opens tools.jackson.jaxrs.base; + opens tools.jackson.jaxrs.base.cfg; +} diff --git a/cbor/pom.xml b/cbor/pom.xml index b49fc898..b7fd2112 100644 --- a/cbor/pom.xml +++ b/cbor/pom.xml @@ -13,7 +13,7 @@ jackson-jaxrs-cbor-provider Jackson-JAXRS: CBOR - bundle + jar Functionality to handle CBOR encoded input/output for JAX-RS implementations (like Jersey and RESTeasy) using standard Jackson data binding. @@ -36,8 +36,8 @@ - jackson-jaxrs-base ${project.groupId} + jackson-jaxrs-base ${project.version} @@ -87,10 +87,6 @@ - - org.moditect - moditect-maven-plugin - diff --git a/cbor/src/main/java/module-info.java b/cbor/src/main/java/module-info.java new file mode 100644 index 00000000..90f460dc --- /dev/null +++ b/cbor/src/main/java/module-info.java @@ -0,0 +1,21 @@ +// JAX-RS CBOR module-info for Main artifact +module tools.jackson.jaxrs.cbor +{ + requires tools.jackson.core; + requires transitive tools.jackson.databind; + requires tools.jackson.dataformat.cbor; + requires tools.jackson.module.jaxb; + + requires tools.jackson.jaxrs.base; + + requires java.ws.rs; + + exports tools.jackson.jaxrs.cbor; + // [jaxrs-providers#119]: CXF, RESTEasy, OpenAPI require reflective access + opens tools.jackson.jaxrs.cbor; + + provides javax.ws.rs.ext.MessageBodyReader with + tools.jackson.jaxrs.cbor.JacksonCBORProvider; + provides javax.ws.rs.ext.MessageBodyWriter with + tools.jackson.jaxrs.cbor.JacksonCBORProvider; +} diff --git a/cbor/src/main/java/tools/jackson/jaxrs/cbor/CBORMapperConfigurator.java b/cbor/src/main/java/tools/jackson/jaxrs/cbor/CBORMapperConfigurator.java index 8bbe4826..8bf5d73a 100644 --- a/cbor/src/main/java/tools/jackson/jaxrs/cbor/CBORMapperConfigurator.java +++ b/cbor/src/main/java/tools/jackson/jaxrs/cbor/CBORMapperConfigurator.java @@ -5,6 +5,7 @@ import tools.jackson.dataformat.cbor.CBORFactory; import tools.jackson.dataformat.cbor.CBORMapper; + import tools.jackson.jaxrs.cfg.MapperConfiguratorBase; /** diff --git a/cbor/src/moditect/module-info.java b/cbor/src/moditect/module-info.java deleted file mode 100644 index b151915b..00000000 --- a/cbor/src/moditect/module-info.java +++ /dev/null @@ -1,29 +0,0 @@ -module tools.jackson.jaxrs.cbor { - exports tools.jackson.jaxrs.cbor; - // [jaxrs-providers#119]: CXF, RESTEasy, OpenAPI require reflective access - opens tools.jackson.jaxrs.cbor; - - requires tools.jackson.core; - requires tools.jackson.databind; - requires tools.jackson.dataformat.cbor; - requires tools.jackson.module.jaxb; - - requires tools.jackson.jaxrs.base; - - //Allow multiple implementations of ws.rs - //oracle location - requires static javax.ws.rs.api; - //oracle location - requires static java.ws.rs; - //jakarta initial location - 2.x - requires static javax.ws.rs; - //jakarta 3.x final location - https://github.com/jboss/jboss-jakarta-jaxrs-api_spec - requires static jakarta.ws.rs; - //jakarta 3.x final location - https://github.com/eclipse-ee4j/jaxrs-api - requires static jakarta.ws.rs.api; - - provides javax.ws.rs.ext.MessageBodyReader with - tools.jackson.jaxrs.cbor.JacksonCBORProvider; - provides javax.ws.rs.ext.MessageBodyWriter with - tools.jackson.jaxrs.cbor.JacksonCBORProvider; -} diff --git a/cbor/src/test/java/module-info.java b/cbor/src/test/java/module-info.java new file mode 100644 index 00000000..e7b3339b --- /dev/null +++ b/cbor/src/test/java/module-info.java @@ -0,0 +1,24 @@ +// JAX-RS CBOR module-info for (unit) Tests +module tools.jackson.jaxrs.cbor +{ + // Since we are not split from Main artifact, will not + // need to depend on Main artifact -- but need its dependencies + + requires tools.jackson.core; + requires tools.jackson.databind; + requires tools.jackson.dataformat.cbor; + requires tools.jackson.module.jaxb; + + requires tools.jackson.jaxrs.base; + + requires java.ws.rs; + + // Additional test lib/framework dependencies + requires junit; // JUnit 4 + + // Further, need to open up test packages for JUnit et al + + opens tools.jackson.jaxrs.cbor; + opens tools.jackson.jaxrs.cbor.dw; + opens tools.jackson.jaxrs.cbor.jersey; +} diff --git a/datatypes/pom.xml b/datatypes/pom.xml index d4d942ce..b6e908e9 100644 --- a/datatypes/pom.xml +++ b/datatypes/pom.xml @@ -15,7 +15,7 @@ tools.jackson.datatype jackson-datatype-jaxrs Jackson-JAXRS: Datatypes - bundle + jar Functionality for reading/writing core JAX-RS helper types @@ -37,6 +37,13 @@ tools.jackson.core jackson-databind + + + + jakarta.xml.bind + jakarta.xml.bind-api + provided + @@ -72,11 +79,6 @@ - - org.moditect - moditect-maven-plugin - - diff --git a/datatypes/src/main/java/module-info.java b/datatypes/src/main/java/module-info.java new file mode 100644 index 00000000..3ba927c2 --- /dev/null +++ b/datatypes/src/main/java/module-info.java @@ -0,0 +1,12 @@ +// JAX-RS Datatypes module-info for Main artifact +module tools.jackson.datatype.jaxrs +{ + requires tools.jackson.core; + requires transitive tools.jackson.databind; + requires java.ws.rs; + + exports tools.jackson.datatype.jaxrs; + + provides tools.jackson.databind.JacksonModule with + tools.jackson.datatype.jaxrs.Jaxrs2TypesModule; +} diff --git a/datatypes/src/moditect/module-info.java b/datatypes/src/moditect/module-info.java deleted file mode 100644 index 78babfcc..00000000 --- a/datatypes/src/moditect/module-info.java +++ /dev/null @@ -1,21 +0,0 @@ -module tools.jackson.datatype.jaxrs { - exports tools.jackson.datatype.jaxrs; - - requires tools.jackson.core; - requires tools.jackson.databind; - - //Allow multiple implementations of ws.rs - //oracle location - requires static javax.ws.rs.api; - //oracle location - requires static java.ws.rs; - //jakarta initial location - 2.x - requires static javax.ws.rs; - //jakarta 3.x final location - https://github.com/jboss/jboss-jakarta-jaxrs-api_spec - requires static jakarta.ws.rs; - //jakarta 3.x final location - https://github.com/eclipse-ee4j/jaxrs-api - requires static jakarta.ws.rs.api; - - provides tools.jackson.databind.JacksonModule with - tools.jackson.datatype.jaxrs.Jaxrs2TypesModule; -} diff --git a/datatypes/src/test/java/module-info.java b/datatypes/src/test/java/module-info.java new file mode 100644 index 00000000..76b06610 --- /dev/null +++ b/datatypes/src/test/java/module-info.java @@ -0,0 +1,17 @@ +// JAX-RS Datatypes module-info for (unit) Tests +module tools.jackson.datatype.jaxrs +{ + // Since we are not split from Main artifact, will not + // need to depend on Main artifact -- but need its dependencies + + requires tools.jackson.core; + requires transitive tools.jackson.databind; + requires java.ws.rs; + + // Additional test lib/framework dependencies + requires junit; // JUnit 4 + + // Further, need to open up test packages for JUnit et al + + opens tools.jackson.datatype.jaxrs; +} diff --git a/json/pom.xml b/json/pom.xml index bc35c5ea..54e4a675 100644 --- a/json/pom.xml +++ b/json/pom.xml @@ -13,7 +13,7 @@ jackson-jaxrs-json-provider Jackson-JAXRS: JSON - bundle + jar Functionality to handle JSON input/output for JAX-RS implementations (like Jersey and RESTeasy) using standard Jackson data binding. @@ -52,25 +52,10 @@ but here we also want to ensure other JAX-RS impls can at least load jackson provider --> - - - org.jboss.resteasy - resteasy-jackson2-provider - 3.15.6.Final - test - - - ${project.groupId} - jackson-jaxrs-json-provider - - - - - org.jboss.resteasy - resteasy-jaxrs - 3.15.6.Final - test - + @@ -107,11 +92,6 @@ - - org.moditect - moditect-maven-plugin - - diff --git a/json/src/main/java/module-info.java b/json/src/main/java/module-info.java new file mode 100644 index 00000000..9287118c --- /dev/null +++ b/json/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// JAX-RS JSON module-info for Main artifact +module tools.jackson.jaxrs.json { + requires tools.jackson.core; + requires transitive tools.jackson.databind; + requires tools.jackson.module.jaxb; + + requires tools.jackson.jaxrs.base; + + requires java.ws.rs; + + exports tools.jackson.jaxrs.json; + // [jaxrs-providers#119]: CXF, RESTEasy, OpenAPI require reflective access + opens tools.jackson.jaxrs.json; + + provides javax.ws.rs.ext.MessageBodyReader with + tools.jackson.jaxrs.json.JacksonJsonProvider; + provides javax.ws.rs.ext.MessageBodyWriter with + tools.jackson.jaxrs.json.JacksonJsonProvider; +} diff --git a/json/src/moditect/module-info.java b/json/src/moditect/module-info.java deleted file mode 100644 index 7f1cec53..00000000 --- a/json/src/moditect/module-info.java +++ /dev/null @@ -1,36 +0,0 @@ -module tools.jackson.jaxrs.json { - exports tools.jackson.jaxrs.json; - exports tools.jackson.jaxrs.json.annotation; - // 13-Nov-2019: [jaxrs-providers#119]: CXF, RESTEasy, OpenAPI require reflective access - opens tools.jackson.jaxrs.json; - - requires com.fasterxml.jackson.annotation; - requires tools.jackson.core; - requires tools.jackson.databind; - requires tools.jackson.module.jaxb; - - requires tools.jackson.jaxrs.base; - - //oracle location - requires static javax.ws.rs.api; - //oracle location - requires static java.ws.rs; - //jakarta initial location - 2.x - requires static javax.ws.rs; - //jakarta 3.x final location - https://github.com/jboss/jboss-jakarta-jaxrs-api_spec - requires static jakarta.ws.rs; - //jakarta 3.x final location - https://github.com/eclipse-ee4j/jaxrs-api - requires static jakarta.ws.rs.api; - - provides javax.ws.rs.ext.MessageBodyReader with - tools.jackson.jaxrs.json.JacksonJsonProvider; - provides javax.ws.rs.ext.MessageBodyWriter with - tools.jackson.jaxrs.json.JacksonJsonProvider; - - //gedmarc - move to custom for jakarta shade -/* - provides jakarta.ws.rs.ext.MessageBodyReader with - tools.jackson.jaxrs.json.JacksonJsonProvider; - provides jakarta.ws.rs.ext.MessageBodyWriter with - tools.jackson.jaxrs.json.JacksonJsonProvider;*/ -} diff --git a/json/src/test/java/module-info.java b/json/src/test/java/module-info.java new file mode 100644 index 00000000..4d64df51 --- /dev/null +++ b/json/src/test/java/module-info.java @@ -0,0 +1,25 @@ +// JAX-RS JSON module-info for (unit) Tests +module tools.jackson.jaxrs.json +{ + // Since we are not split from Main artifact, will not + // need to depend on Main artifact -- but need its dependencies + + requires tools.jackson.core; + requires tools.jackson.databind; + requires tools.jackson.module.jaxb; + + requires tools.jackson.jaxrs.base; + + requires java.ws.rs; + + // Additional test lib/framework dependencies + requires junit; // JUnit 4 + + // Further, need to open up test packages for JUnit et al + + opens tools.jackson.jaxrs.json; + opens tools.jackson.jaxrs.json.dw; + opens tools.jackson.jaxrs.json.jersey; + opens tools.jackson.jaxrs.json.testutil; + opens tools.jackson.jaxrs.json.util; +} diff --git a/json/src/test/java/tools/jackson/jaxrs/json/resteasy/RestEasyProviderLoadingTest.java b/json/src/test/java/tools/jackson/jaxrs/json/resteasy/RestEasyProviderLoadingTest.java deleted file mode 100644 index 855fa8cb..00000000 --- a/json/src/test/java/tools/jackson/jaxrs/json/resteasy/RestEasyProviderLoadingTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package tools.jackson.jaxrs.json.resteasy; - -import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider; - -import tools.jackson.jaxrs.json.JaxrsTestBase; - -public class RestEasyProviderLoadingTest extends JaxrsTestBase -{ - public void testLoading() throws Exception - { - // 13-Aug-2022, tatu: Won't work, this is Jackson 3.x, not 2.x - // Should probably just delete the test but comment out for now - - ResteasyJackson2Provider prov = null; - /* - ResteasyJackson2Provider provider = new ResteasyJackson2Provider(); - assertNotNull(provider); // just to avoid compiler warning - */ - } -} diff --git a/pom.xml b/pom.xml index de13e2a6..ae8a7bd9 100644 --- a/pom.xml +++ b/pom.xml @@ -52,6 +52,11 @@ jakarta.xml.bind-api 2.3.3 + + javax.ws.rs + javax.ws.rs-api + 2.1.1 + @@ -63,15 +68,9 @@ javax.ws.rs javax.ws.rs-api - 2.1.1 provided - org.eclipse.jetty jetty-server @@ -85,6 +84,9 @@ test + org.glassfish.jersey.core jersey-server @@ -171,22 +173,11 @@ https://stackoverflow.com/questions/44088493/jersey-stopped-working-with-injecti - - org.moditect - moditect-maven-plugin - - - 11 - - - - + de.jjohannes gradle-module-metadata-maven-plugin diff --git a/release-notes/VERSION b/release-notes/VERSION index b53a88a8..64a52431 100644 --- a/release-notes/VERSION +++ b/release-notes/VERSION @@ -16,6 +16,7 @@ Sub-modules: #123: Change `jackson-module-jaxb-annotations` dependency to `optional` in `pom.xml`s (requested by @gopackgo90) +#206: Change 3.0 to use `module-info.java` directly [JSTEP-11] - Minimum Java baseline: Java 17 - Remove `Annotations` enum abstraction, replace with direct `AnnotationIntrospector` configuration. diff --git a/smile/pom.xml b/smile/pom.xml index e35f72fd..510412d2 100644 --- a/smile/pom.xml +++ b/smile/pom.xml @@ -13,7 +13,7 @@ jackson-jaxrs-smile-provider Jackson-JAXRS: Smile - bundle + jar Functionality to handle Smile (binary JSON) input/output for JAX-RS implementations (like Jersey and RESTeasy) using standard Jackson data binding. @@ -87,11 +87,6 @@ - - org.moditect - moditect-maven-plugin - - diff --git a/smile/src/main/java/module-info.java b/smile/src/main/java/module-info.java new file mode 100644 index 00000000..983c770a --- /dev/null +++ b/smile/src/main/java/module-info.java @@ -0,0 +1,21 @@ +// JAX-RS Smile module-info for Main artifact +module tools.jackson.jaxrs.smile +{ + requires tools.jackson.core; + requires transitive tools.jackson.databind; + requires tools.jackson.dataformat.smile; + requires tools.jackson.module.jaxb; + + requires tools.jackson.jaxrs.base; + + requires java.ws.rs; + + exports tools.jackson.jaxrs.smile; + // [jaxrs-providers#119]: CXF, RESTEasy, OpenAPI require reflective access + opens tools.jackson.jaxrs.smile; + + provides javax.ws.rs.ext.MessageBodyReader with + tools.jackson.jaxrs.smile.JacksonSmileProvider; + provides javax.ws.rs.ext.MessageBodyWriter with + tools.jackson.jaxrs.smile.JacksonSmileProvider; +} diff --git a/smile/src/moditect/module-info.java b/smile/src/moditect/module-info.java deleted file mode 100644 index 60f2e2be..00000000 --- a/smile/src/moditect/module-info.java +++ /dev/null @@ -1,29 +0,0 @@ -module tools.jackson.jaxrs.smile { - exports tools.jackson.jaxrs.smile; - // [jaxrs-providers#119]: CXF, RESTEasy, OpenAPI require reflective access - opens tools.jackson.jaxrs.smile; - - requires tools.jackson.core; - requires tools.jackson.databind; - requires tools.jackson.dataformat.smile; - requires tools.jackson.module.jaxb; - - requires tools.jackson.jaxrs.base; - - //Allow multiple implementations of ws.rs - //oracle location - requires static javax.ws.rs.api; - //oracle location - requires static java.ws.rs; - //jakarta initial location - 2.x - requires static javax.ws.rs; - //jakarta 3.x final location - https://github.com/jboss/jboss-jakarta-jaxrs-api_spec - requires static jakarta.ws.rs; - //jakarta 3.x final location - https://github.com/eclipse-ee4j/jaxrs-api - requires static jakarta.ws.rs.api; - - provides javax.ws.rs.ext.MessageBodyReader with - tools.jackson.jaxrs.smile.JacksonSmileProvider; - provides javax.ws.rs.ext.MessageBodyWriter with - tools.jackson.jaxrs.smile.JacksonSmileProvider; -} diff --git a/smile/src/test/java/module-info.java b/smile/src/test/java/module-info.java new file mode 100644 index 00000000..817ebfe6 --- /dev/null +++ b/smile/src/test/java/module-info.java @@ -0,0 +1,24 @@ +// JAX-RS Smile module-info for (unit) Tests +module tools.jackson.jaxrs.smile +{ + // Since we are not split from Main artifact, will not + // need to depend on Main artifact -- but need its dependencies + + requires tools.jackson.core; + requires tools.jackson.databind; + requires tools.jackson.dataformat.smile; + requires tools.jackson.module.jaxb; + + requires tools.jackson.jaxrs.base; + + requires java.ws.rs; + + // Additional test lib/framework dependencies + requires junit; // JUnit 4 + + // Further, need to open up test packages for JUnit et al + + opens tools.jackson.jaxrs.smile; + opens tools.jackson.jaxrs.smile.dw; + opens tools.jackson.jaxrs.smile.jersey; +} diff --git a/xml/pom.xml b/xml/pom.xml index b3062c82..b66ce34f 100644 --- a/xml/pom.xml +++ b/xml/pom.xml @@ -13,7 +13,7 @@ jackson-jaxrs-xml-provider Jackson-JAXRS: XML - bundle + jar Functionality to handle XML input/output for JAX-RS implementations (like Jersey and RESTeasy) using standard Jackson data binding. @@ -109,11 +109,6 @@ - - org.moditect - moditect-maven-plugin - - diff --git a/xml/src/main/java/module-info.java b/xml/src/main/java/module-info.java new file mode 100644 index 00000000..7dadb6bd --- /dev/null +++ b/xml/src/main/java/module-info.java @@ -0,0 +1,21 @@ +// JAX-RS XML module-info for Main artifact +module tools.jackson.jaxrs.xml +{ + requires tools.jackson.core; + requires transitive tools.jackson.databind; + requires tools.jackson.dataformat.xml; + requires tools.jackson.module.jaxb; + + requires tools.jackson.jaxrs.base; + + requires java.ws.rs; + + exports tools.jackson.jaxrs.xml; + // [jaxrs-providers#119]: CXF, RESTEasy, OpenAPI require reflective access + opens tools.jackson.jaxrs.xml; + + provides javax.ws.rs.ext.MessageBodyReader with + tools.jackson.jaxrs.xml.JacksonXMLProvider; + provides javax.ws.rs.ext.MessageBodyWriter with + tools.jackson.jaxrs.xml.JacksonXMLProvider; +} diff --git a/xml/src/moditect/module-info.java b/xml/src/moditect/module-info.java deleted file mode 100644 index 648e917b..00000000 --- a/xml/src/moditect/module-info.java +++ /dev/null @@ -1,29 +0,0 @@ -module tools.jackson.jaxrs.xml { - exports tools.jackson.jaxrs.xml; - // [jaxrs-providers#119]: CXF, RESTEasy, OpenAPI require reflective access - opens tools.jackson.jaxrs.xml; - - requires tools.jackson.core; - requires tools.jackson.databind; - requires tools.jackson.dataformat.xml; - requires tools.jackson.module.jaxb; - - requires tools.jackson.jaxrs.base; - - //Allow multiple implementations of ws.rs - //oracle location - requires static javax.ws.rs.api; - //oracle location - requires static java.ws.rs; - //jakarta initial location - 2.x - requires static javax.ws.rs; - //jakarta 3.x final location - https://github.com/jboss/jboss-jakarta-jaxrs-api_spec - requires static jakarta.ws.rs; - //jakarta 3.x final location - https://github.com/eclipse-ee4j/jaxrs-api - requires static jakarta.ws.rs.api; - - provides javax.ws.rs.ext.MessageBodyReader with - tools.jackson.jaxrs.xml.JacksonXMLProvider; - provides javax.ws.rs.ext.MessageBodyWriter with - tools.jackson.jaxrs.xml.JacksonXMLProvider; -} diff --git a/xml/src/test/java/module-info.java b/xml/src/test/java/module-info.java new file mode 100644 index 00000000..6bddc335 --- /dev/null +++ b/xml/src/test/java/module-info.java @@ -0,0 +1,24 @@ +// JAX-RS XML module-info for (unit) Tests +module tools.jackson.jaxrs.xml +{ + // Since we are not split from Main artifact, will not + // need to depend on Main artifact -- but need its dependencies + + requires tools.jackson.core; + requires tools.jackson.databind; + requires tools.jackson.dataformat.xml; + requires tools.jackson.module.jaxb; + + requires tools.jackson.jaxrs.base; + + requires java.ws.rs; + + // Additional test lib/framework dependencies + requires junit; // JUnit 4 + + // Further, need to open up test packages for JUnit et al + + opens tools.jackson.jaxrs.xml; + opens tools.jackson.jaxrs.xml.dw; + opens tools.jackson.jaxrs.xml.jersey; +} diff --git a/yaml/pom.xml b/yaml/pom.xml index 088bfad7..c2c79d2a 100644 --- a/yaml/pom.xml +++ b/yaml/pom.xml @@ -13,7 +13,7 @@ jackson-jaxrs-yaml-provider Jackson-JAXRS: YAML - bundle + jar Functionality to handle YAML input/output for JAX-RS implementations (like Jersey and RESTeasy) using standard Jackson data binding. @@ -102,11 +102,6 @@ using standard Jackson data binding. - - org.moditect - moditect-maven-plugin - - diff --git a/yaml/src/main/java/module-info.java b/yaml/src/main/java/module-info.java new file mode 100644 index 00000000..86e96776 --- /dev/null +++ b/yaml/src/main/java/module-info.java @@ -0,0 +1,21 @@ +// JAX-RS YAML module-info for Main artifact +module tools.jackson.jaxrs.yaml +{ + requires tools.jackson.core; + requires transitive tools.jackson.databind; + requires tools.jackson.dataformat.yaml; + requires tools.jackson.module.jaxb; + + requires tools.jackson.jaxrs.base; + + requires java.ws.rs; + + exports tools.jackson.jaxrs.yaml; + // [jaxrs-providers#119]: CXF, RESTEasy, OpenAPI require reflective access + opens tools.jackson.jaxrs.yaml; + + provides javax.ws.rs.ext.MessageBodyReader with + tools.jackson.jaxrs.yaml.JacksonYAMLProvider; + provides javax.ws.rs.ext.MessageBodyWriter with + tools.jackson.jaxrs.yaml.JacksonYAMLProvider; +} diff --git a/yaml/src/moditect/module-info.java b/yaml/src/moditect/module-info.java deleted file mode 100644 index f3034e9e..00000000 --- a/yaml/src/moditect/module-info.java +++ /dev/null @@ -1,29 +0,0 @@ -module tools.jackson.jaxrs.yaml { - exports tools.jackson.jaxrs.yaml; - // [jaxrs-providers#119]: CXF, RESTEasy, OpenAPI require reflective access - opens tools.jackson.jaxrs.yaml; - - requires tools.jackson.core; - requires tools.jackson.databind; - requires tools.jackson.dataformat.yaml; - requires tools.jackson.module.jaxb; - - requires tools.jackson.jaxrs.base; - - //Allow multiple implementations of ws.rs - //oracle location - requires static javax.ws.rs.api; - //oracle location - requires static java.ws.rs; - //jakarta initial location - 2.x - requires static javax.ws.rs; - //jakarta 3.x final location - https://github.com/jboss/jboss-jakarta-jaxrs-api_spec - requires static jakarta.ws.rs; - //jakarta 3.x final location - https://github.com/eclipse-ee4j/jaxrs-api - requires static jakarta.ws.rs.api; - - provides javax.ws.rs.ext.MessageBodyReader with - tools.jackson.jaxrs.yaml.JacksonYAMLProvider; - provides javax.ws.rs.ext.MessageBodyWriter with - tools.jackson.jaxrs.yaml.JacksonYAMLProvider; -} diff --git a/yaml/src/test/java/module-info.java b/yaml/src/test/java/module-info.java new file mode 100644 index 00000000..0541665f --- /dev/null +++ b/yaml/src/test/java/module-info.java @@ -0,0 +1,30 @@ +// JAX-RS YAML module-info for (unit) Tests +module tools.jackson.jaxrs.yaml +{ + // Since we are not split from Main artifact, will not + // need to depend on Main artifact -- but need its dependencies + + requires tools.jackson.core; + requires tools.jackson.databind; + requires tools.jackson.dataformat.yaml; + requires tools.jackson.module.jaxb; + + requires tools.jackson.jaxrs.base; + + requires java.ws.rs; + + // Additional test lib/framework dependencies + requires junit; // JUnit 4 + + // Other test deps: we test format-negotiation so need JSON and Smile providers + + requires tools.jackson.jaxrs.json; + requires tools.jackson.jaxrs.smile; + requires tools.jackson.dataformat.smile; + + // Further, need to open up test packages for JUnit et al + + opens tools.jackson.jaxrs.yaml; + opens tools.jackson.jaxrs.yaml.dw; + opens tools.jackson.jaxrs.yaml.jersey; +} diff --git a/yaml/src/test/java/tools/jackson/jaxrs/yaml/dw/SimpleEndpointTestBase.java b/yaml/src/test/java/tools/jackson/jaxrs/yaml/dw/SimpleEndpointTestBase.java index 1e4153f6..558ec5bf 100644 --- a/yaml/src/test/java/tools/jackson/jaxrs/yaml/dw/SimpleEndpointTestBase.java +++ b/yaml/src/test/java/tools/jackson/jaxrs/yaml/dw/SimpleEndpointTestBase.java @@ -1,8 +1,22 @@ package tools.jackson.jaxrs.yaml.dw; +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URL; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + import tools.jackson.databind.ObjectMapper; -import tools.jackson.dataformat.smile.SmileFactory; +import tools.jackson.databind.json.JsonMapper; + +import tools.jackson.dataformat.smile.SmileMapper; + import tools.jackson.dataformat.yaml.YAMLMapper; + import tools.jackson.jaxrs.json.JacksonJsonProvider; import tools.jackson.jaxrs.smile.JacksonSmileProvider; import tools.jackson.jaxrs.smile.SmileMediaTypes; @@ -12,16 +26,6 @@ import org.eclipse.jetty.server.Server; import org.junit.Assert; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import java.io.IOException; -import java.io.InputStream; -import java.net.HttpURLConnection; -import java.net.URL; - public abstract class SimpleEndpointTestBase extends ResourceTestBase { final static int TEST_PORT = 6011; @@ -163,8 +167,8 @@ public void testMultipleMediaTypes() throws Exception Point p; final ObjectMapper yamlMapper = new YAMLMapper(); - final ObjectMapper jsonMapper = new ObjectMapper(); - final ObjectMapper smileMapper = new ObjectMapper(new SmileFactory()); + final ObjectMapper jsonMapper = new JsonMapper(); + final ObjectMapper smileMapper = new SmileMapper(); try {