Skip to content

Commit 8275f8d

Browse files
committed
Build as multi release jar
- make jakarta and javax annotation modules optional at runtime - update GitHub Action to JDK 11 - added module info in java9 source folder - added executions for java 8 and 9 - removed automatic module - added multi release entry to manifest
1 parent 8099892 commit 8275f8d

File tree

3 files changed

+39
-10
lines changed

3 files changed

+39
-10
lines changed

.github/workflows/maven_release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 0
18-
- name: Set up JDK 8
18+
- name: Set up JDK 11
1919
uses: actions/setup-java@v3
2020
with:
21-
java-version: 8
21+
java-version: 11
2222
distribution: 'temurin'
2323
- name: Cache Maven packages
2424
uses: actions/cache@v3
@@ -37,10 +37,10 @@ jobs:
3737
- uses: actions/checkout@v3
3838
with:
3939
fetch-depth: 0
40-
- name: Set up JDK 8
40+
- name: Set up JDK 11
4141
uses: actions/setup-java@v3
4242
with:
43-
java-version: 8
43+
java-version: 11
4444
distribution: 'temurin'
4545
- name: Cache Maven packages
4646
uses: actions/cache@v3
@@ -74,7 +74,7 @@ jobs:
7474
- name: Set up Maven Central Repository
7575
uses: actions/setup-java@v3
7676
with:
77-
java-version: 8
77+
java-version: 11
7878
distribution: 'temurin'
7979
server-id: central
8080
server-username: MAVEN_USERNAME

pom.xml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,32 @@
8181
<plugin>
8282
<artifactId>maven-compiler-plugin</artifactId>
8383
<version>3.14.0</version>
84-
<configuration>
85-
<source>1.8</source>
86-
<target>1.8</target>
87-
</configuration>
84+
<executions>
85+
<execution>
86+
<id>compile-java-8</id>
87+
<goals>
88+
<goal>compile</goal>
89+
</goals>
90+
<configuration>
91+
<source>1.8</source>
92+
<target>1.8</target>
93+
</configuration>
94+
</execution>
95+
<execution>
96+
<id>compile-java-9</id>
97+
<phase>compile</phase>
98+
<goals>
99+
<goal>compile</goal>
100+
</goals>
101+
<configuration>
102+
<release>9</release>
103+
<compileSourceRoots>
104+
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
105+
</compileSourceRoots>
106+
<multiReleaseOutput>true</multiReleaseOutput>
107+
</configuration>
108+
</execution>
109+
</executions>
88110
</plugin>
89111
<plugin>
90112
<groupId>org.apache.maven.plugins</groupId>
@@ -93,7 +115,7 @@
93115
<configuration>
94116
<archive>
95117
<manifestEntries>
96-
<Automatic-Module-Name>org.openapitools.jackson.nullable</Automatic-Module-Name>
118+
<Multi-Release>true</Multi-Release>
97119
</manifestEntries>
98120
</archive>
99121
</configuration>

src/main/java9/module-info.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module org.openapitools.jackson.nullable {
2+
requires com.fasterxml.jackson.databind;
3+
requires static jakarta.validation;
4+
requires static java.validation;
5+
6+
exports org.openapitools.jackson.nullable;
7+
}

0 commit comments

Comments
 (0)