Skip to content

JSTEP 11

Tatu Saloranta edited this page Jan 15, 2025 · 6 revisions

(Back to JSTEP page)


JSTEP-11: Use native JPMS module-info.java

Author

Tatu Saloranta (@cowtowncoder)

Version History

  • 2025-01-14: Initial version

Background

Jackson 2.x requires Java 8 as the minimum version, and as such cannot build Java module (JPMS) info (module-info.class) via normal build process. Instead, Moditect plug-in is used to create minimally processed version from module-info.java, to be embedded. But while Moditect can produce legal module-info.class, it does not (and probably cannot) validate goodness to same degree as build does. This means that catching invalid module info declarations is difficult and cannot be done during development or build time, or even CI (at least without extensive external tooling).

These problems can be resolved for Jackson 3.0 when the JDK baseline is raised to 17.

Scope

Conversion requires doing following:

  1. Copy src/moditect/module-info.java as both src/main/java/module-info.java and src/test/java/module-info.java
  2. Remove src/moditect/module-info.java
  3. Remove moditect-maven-plugin invocation from pom.xml
  4. Modify src/main/java/module-info.java to work for building main artifact (often adding a module dependency or two; possibly needing changes to "upstream" dependency)
  5. Modify src/test/java/module-info.java to work for unit tests (may need changes to main artifact module-info.java)

And once full build (./mvnw clean install) works, initial conversion should be complete. Note, tho, that further changes may be needed by "downstream" components once they use full "modularized" build

Status

Completed

Completed, core

Completed, data format modules

Planned

Planned, data format modules

Planned, data type modules

Planned, other modules

Planned, Providers

Planned, other modules