Skip to content

Commit

Permalink
Fix #206: use proper module-info.java for building (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder authored Jan 23, 2025
1 parent 4c4447a commit 04016d1
Show file tree
Hide file tree
Showing 33 changed files with 346 additions and 312 deletions.
20 changes: 9 additions & 11 deletions base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</parent>
<artifactId>jackson-jaxrs-base</artifactId>
<name>Jackson-JAXRS-base</name>
<packaging>bundle</packaging>
<packaging>jar</packaging>
<description>Pile of code that is shared by all Jackson-based JAX-RS
providers.
</description>
Expand Down Expand Up @@ -42,16 +42,14 @@ ${project.groupId}.annotation.*;version=${project.version}
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- test deps should come from parent -->
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
</plugin>
<!-- 22-Jan-2025, tatu: Not 100% why this is needed here but... it is -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<scope>provided</scope>
</dependency>

</plugins>
</build>
<!-- test deps should come from parent -->
</dependencies>
</project>
14 changes: 14 additions & 0 deletions base/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -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;
}
22 changes: 0 additions & 22 deletions base/src/moditect/module-info.java

This file was deleted.

18 changes: 18 additions & 0 deletions base/src/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -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;
}
8 changes: 2 additions & 6 deletions cbor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</parent>
<artifactId>jackson-jaxrs-cbor-provider</artifactId>
<name>Jackson-JAXRS: CBOR</name>
<packaging>bundle</packaging>
<packaging>jar</packaging>
<description>Functionality to handle CBOR encoded input/output for JAX-RS implementations (like Jersey and RESTeasy) using standard Jackson data binding.
</description>

Expand All @@ -36,8 +36,8 @@
<dependencies>
<!-- builds on shared base JAX-RS handling code... -->
<dependency>
<artifactId>jackson-jaxrs-base</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>jackson-jaxrs-base</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Extends Jackson core, mapper, and also (sort of optionally) on JAXB annotation handler -->
Expand Down Expand Up @@ -87,10 +87,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
</plugin>

</plugins>
</build>
Expand Down
21 changes: 21 additions & 0 deletions cbor/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import tools.jackson.dataformat.cbor.CBORFactory;
import tools.jackson.dataformat.cbor.CBORMapper;

import tools.jackson.jaxrs.cfg.MapperConfiguratorBase;

/**
Expand Down
29 changes: 0 additions & 29 deletions cbor/src/moditect/module-info.java

This file was deleted.

24 changes: 24 additions & 0 deletions cbor/src/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -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;
}
14 changes: 8 additions & 6 deletions datatypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<groupId>tools.jackson.datatype</groupId>
<artifactId>jackson-datatype-jaxrs</artifactId>
<name>Jackson-JAXRS: Datatypes</name>
<packaging>bundle</packaging>
<packaging>jar</packaging>
<description>Functionality for reading/writing core JAX-RS helper types
</description>

Expand All @@ -37,6 +37,13 @@
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<!-- 22-Jan-2025, tatu: Not 100% why this is needed here but... it is -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -72,11 +79,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
</plugin>

</plugins>
</build>
</project>
12 changes: 12 additions & 0 deletions datatypes/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -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;
}
21 changes: 0 additions & 21 deletions datatypes/src/moditect/module-info.java

This file was deleted.

17 changes: 17 additions & 0 deletions datatypes/src/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -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;
}
30 changes: 5 additions & 25 deletions json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</parent>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<name>Jackson-JAXRS: JSON</name>
<packaging>bundle</packaging>
<packaging>jar</packaging>
<description>Functionality to handle JSON input/output for JAX-RS implementations (like Jersey and RESTeasy) using standard Jackson data binding.
</description>

Expand Down Expand Up @@ -52,25 +52,10 @@
but here we also want to ensure other JAX-RS impls can
at least load jackson provider
-->

<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>3.15.6.Final</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>${project.groupId}</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.15.6.Final</version>
<scope>test</scope>
</dependency>
<!-- 22-Jan-2025, tatu: No can do, with modules... may be able
to put something back if and when there's
RESTeasy/Jackson-3 provider
-->

</dependencies>
<build>
Expand Down Expand Up @@ -107,11 +92,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
</plugin>

</plugins>
</build>
</project>
19 changes: 19 additions & 0 deletions json/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -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;
}
Loading

0 comments on commit 04016d1

Please sign in to comment.