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
6 changes: 3 additions & 3 deletions .github/workflows/maven_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
java-version: 8
java-version: 11
distribution: 'temurin'
- name: Cache and restore Maven packages on master
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Set up Maven Central Repository
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
java-version: 8
java-version: 11
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maven_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
java-version: 8
java-version: 11
distribution: 'temurin'
- name: Cache and restore Maven packages on master
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
Expand Down
33 changes: 27 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<!-- Generate PackageVersion.java into this directory. -->
<packageVersion.dir>org/openapitools/jackson/nullable</packageVersion.dir>
<packageVersion.package>${project.groupId}.jackson.nullable</packageVersion.package>
<java.version>1.8</java.version>
<java.version>8</java.version>

<!-- region Dependency Versions -->
<!-- Validator 8+ requires Java 11, Validator 9+ requires Java 17. -->
Expand Down Expand Up @@ -141,10 +141,31 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
<executions>
<execution>
<id>compile-java-8</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>${java.version}</release>
</configuration>
</execution>
<execution>
<id>compile-java-9</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -179,7 +200,7 @@
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>org.openapitools.jackson.nullable</Automatic-Module-Name>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
Expand Down
11 changes: 11 additions & 0 deletions src/main/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module org.openapitools.jackson.nullable {
requires com.fasterxml.jackson.databind;
requires static jakarta.validation;
requires static java.validation;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work correctly in projects that only have the javax OR jakarta dependency? This project has both as a provided scope, so I expect tests/compile will pass. However an application/library that depends on this project will typically only have one or the other.

Sorry, I'm not super familiar with the module system.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have used this in one project when I first created the PR. That project is now suspended, but it worked with JLink at the time. I only hat the Jakarta namespace in that project.


exports org.openapitools.jackson.nullable;

provides com.fasterxml.jackson.databind.Module with org.openapitools.jackson.nullable.JsonNullableModule;
provides javax.validation.valueextraction.ValueExtractor with org.openapitools.jackson.nullable.JsonNullableValueExtractor;
provides jakarta.validation.valueextraction.ValueExtractor with org.openapitools.jackson.nullable.JsonNullableJakartaValueExtractor;
}