Skip to content

Commit ee2b68d

Browse files
committed
Build as multi release jar
- make jakarta and javax annotation modules optional at runtime - update travis ci to jdk 9 multi-release-jar - 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 6687b74 commit ee2b68d

3 files changed

Lines changed: 35 additions & 6 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: java
22
jdk:
3-
- openjdk8
3+
- openjdk9
44

55
cache:
66
directories:

pom.xml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,40 @@
8585
</plugin>
8686
<plugin>
8787
<artifactId>maven-compiler-plugin</artifactId>
88-
<configuration>
89-
<source>1.8</source>
90-
<target>1.8</target>
91-
</configuration>
88+
<executions>
89+
<execution>
90+
<id>compile-java-8</id>
91+
<goals>
92+
<goal>compile</goal>
93+
</goals>
94+
<configuration>
95+
<source>1.8</source>
96+
<target>1.8</target>
97+
</configuration>
98+
</execution>
99+
<execution>
100+
<id>compile-java-9</id>
101+
<phase>compile</phase>
102+
<goals>
103+
<goal>compile</goal>
104+
</goals>
105+
<configuration>
106+
<release>9</release>
107+
<compileSourceRoots>
108+
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
109+
</compileSourceRoots>
110+
<multiReleaseOutput>true</multiReleaseOutput>
111+
</configuration>
112+
</execution>
113+
</executions>
92114
</plugin>
93115
<plugin>
94116
<groupId>org.apache.maven.plugins</groupId>
95117
<artifactId>maven-jar-plugin</artifactId>
96118
<configuration>
97119
<archive>
98120
<manifestEntries>
99-
<Automatic-Module-Name>org.openapitools.jackson.nullable</Automatic-Module-Name>
121+
<Multi-Release>true</Multi-Release>
100122
</manifestEntries>
101123
</archive>
102124
</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)