Skip to content

Commit 951d073

Browse files
authored
Merge pull request #527 from FasterXML/tatu/add-module-info
Add simple module-info for JDK9+, using Moditect
2 parents 11a4ed6 + a465742 commit 951d073

File tree

3 files changed

+51
-6
lines changed

3 files changed

+51
-6
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ language: java
22
# 08-Dec-2018, tatu: While it should be possible to run core streaming on Java 6,
33
# build won't work with anything below Java 8 now
44
- openjdk8
5+
- oraclejdk11
56

67
# Below this line is configuration for deploying to the Sonatype OSS repo
78
# http://blog.xeiam.com/2013/05/configure-travis-ci-to-deploy-snapshots.html

pom.xml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@
2323
</scm>
2424

2525
<properties>
26-
<!-- 16-Sep-2016, tatu: Retain Java6/JDK1.6 compatibility for streaming for Jackson 2.x -->
26+
<!-- 04-Mar-2019, tatu: Retain Java6/JDK1.6 compatibility for annotations for Jackson 2.x,
27+
but use Moditect to get JDK9+ module info support; need newer bundle plugin as well
28+
-->
2729
<javac.src.version>1.6</javac.src.version>
2830
<javac.target.version>1.6</javac.target.version>
2931

30-
<!-- 04-May-2016, tatu: Bundle-plugin 3.x seems to require Java 7, so to
31-
build for Java 6 need to downgrade here to last working 2.x version
32-
(2.5.4 had some issues wrt shading)
33-
-->
34-
<version.plugin.bundle>2.5.3</version.plugin.bundle>
32+
<maven.compiler.source>1.6</maven.compiler.source>
33+
<maven.compiler.target>1.6</maven.compiler.target>
34+
35+
<version.plugin.bundle>3.2.0</version.plugin.bundle>
3536

3637
<osgi.export>com.fasterxml.jackson.core;version=${project.version},
3738
com.fasterxml.jackson.core.*;version=${project.version}
@@ -95,6 +96,30 @@ com.fasterxml.jackson.core.*;version=${project.version}
9596
<groupId>com.google.code.maven-replacer-plugin</groupId>
9697
<artifactId>replacer</artifactId>
9798
</plugin>
99+
100+
<!-- 04-Mar-2019, tatu: Add rudimentary JDK9+ module info. To build with JDK 8
101+
will have to use `moduleInfoFile` which is crappy but anything else requires
102+
JDK 9+. With Jackson 3.0 will upgrade.
103+
-->
104+
<plugin>
105+
<groupId>org.moditect</groupId>
106+
<artifactId>moditect-maven-plugin</artifactId>
107+
<executions>
108+
<execution>
109+
<id>add-module-infos</id>
110+
<phase>package</phase>
111+
<goals>
112+
<goal>add-module-info</goal>
113+
</goals>
114+
<configuration>
115+
<overwriteExistingFiles>true</overwriteExistingFiles>
116+
<module>
117+
<moduleInfoFile>src/moditect/module-info.java</moduleInfoFile>
118+
</module>
119+
</configuration>
120+
</execution>
121+
</executions>
122+
</plugin>
98123
</plugins>
99124
</build>
100125

src/moditect/module-info.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module com.fasterxml.jackson.core {
2+
// 04-Mar-2019, tatu: Ugh. Can not use wildcards, stupid ass JDK 9+ module system...
3+
// So, for 2.x core need to make sure we manually include everything.
4+
// Worse, there is only syntactic validation, not contents, so we can both miss
5+
// AND add bogus packages.
6+
// However: at least syntax is verified; and this works with JKD8
7+
exports com.fasterxml.jackson.core;
8+
exports com.fasterxml.jackson.core.async;
9+
exports com.fasterxml.jackson.core.base;
10+
exports com.fasterxml.jackson.core.exc;
11+
exports com.fasterxml.jackson.core.filter;
12+
exports com.fasterxml.jackson.core.format;
13+
exports com.fasterxml.jackson.core.io;
14+
exports com.fasterxml.jackson.core.json;
15+
exports com.fasterxml.jackson.core.json.async;
16+
exports com.fasterxml.jackson.core.sym;
17+
exports com.fasterxml.jackson.core.type;
18+
exports com.fasterxml.jackson.core.util;
19+
}

0 commit comments

Comments
 (0)