Skip to content

Commit 27718c0

Browse files
authored
Full Java Platform Module System support for Java 9+ (#2846)
As much as automatic modules do the job for now, jlink requires explicit module definition.
1 parent f86880f commit 27718c0

File tree

6 files changed

+117
-35
lines changed

6 files changed

+117
-35
lines changed

pom.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ We use these goals frequently to keep the dependencies and plugins up-to-date:
2626
</parent>
2727
<groupId>io.vavr</groupId>
2828
<artifactId>vavr-parent</artifactId>
29-
<version>0.10.4</version>
29+
<version>0.10.5-SNAPSHOT</version>
3030
<packaging>pom</packaging>
3131
<name>Vavr Parent</name>
3232
<description>Vavr (formerly called Javaslang) is an object-functional language extension to Java 8+.</description>
@@ -49,7 +49,7 @@ We use these goals frequently to keep the dependencies and plugins up-to-date:
4949
<connection>scm:git:[email protected]:vavr-io/vavr.git</connection>
5050
<developerConnection>scm:git:[email protected]:vavr-io/vavr.git</developerConnection>
5151
<url>[email protected]:vavr-io/vavr.git</url>
52-
<tag>v0.10.4</tag>
52+
<tag>HEAD</tag>
5353
</scm>
5454
<developers>
5555
<developer>
@@ -86,6 +86,7 @@ We use these goals frequently to keep the dependencies and plugins up-to-date:
8686
<maven.surefire.version>3.5.1</maven.surefire.version>
8787
<maven.source.version>3.3.1</maven.source.version>
8888
<maven.exec.version>3.4.1</maven.exec.version>
89+
<moditect.version>1.2.2.Final</moditect.version>
8990
<scala.maven.version>4.9.2</scala.maven.version>
9091
<scala.version>3.5.1</scala.version>
9192
</properties>
@@ -160,6 +161,11 @@ We use these goals frequently to keep the dependencies and plugins up-to-date:
160161
</execution>
161162
</executions>
162163
</plugin>
164+
<plugin>
165+
<groupId>org.moditect</groupId>
166+
<artifactId>moditect-maven-plugin</artifactId>
167+
<version>${moditect.version}</version>
168+
</plugin>
163169
<plugin>
164170
<groupId>org.apache.maven.plugins</groupId>
165171
<artifactId>maven-clean-plugin</artifactId>

vavr-benchmark/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.vavr</groupId>
55
<artifactId>vavr-parent</artifactId>
6-
<version>0.10.4</version>
6+
<version>0.10.5-SNAPSHOT</version>
77
<relativePath>../pom.xml</relativePath>
88
</parent>
99
<artifactId>vavr-benchmark</artifactId>

vavr-match-processor/pom.xml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.vavr</groupId>
55
<artifactId>vavr-parent</artifactId>
6-
<version>0.10.4</version>
6+
<version>0.10.5-SNAPSHOT</version>
77
<relativePath>../pom.xml</relativePath>
88
</parent>
99
<artifactId>vavr-match-processor</artifactId>
@@ -53,13 +53,6 @@
5353
<plugin>
5454
<groupId>org.apache.maven.plugins</groupId>
5555
<artifactId>maven-jar-plugin</artifactId>
56-
<configuration>
57-
<archive>
58-
<manifestEntries>
59-
<Automatic-Module-Name>io.vavr.match.processor</Automatic-Module-Name>
60-
</manifestEntries>
61-
</archive>
62-
</configuration>
6356
</plugin>
6457
<plugin>
6558
<groupId>org.apache.maven.plugins</groupId>
@@ -69,6 +62,33 @@
6962
<groupId>org.apache.felix</groupId>
7063
<artifactId>maven-bundle-plugin</artifactId>
7164
</plugin>
65+
<plugin>
66+
<groupId>org.moditect</groupId>
67+
<artifactId>moditect-maven-plugin</artifactId>
68+
<executions>
69+
<execution>
70+
<id>add-module-infos</id>
71+
<goals>
72+
<goal>add-module-info</goal>
73+
</goals>
74+
<phase>package</phase>
75+
<configuration>
76+
<jvmVersion>9</jvmVersion>
77+
<module>
78+
<moduleInfoSource>
79+
module io.vavr.match.processor {
80+
exports io.vavr.match;
81+
exports io.vavr.match.generator;
82+
exports io.vavr.match.model;
83+
requires io.vavr.match;
84+
}
85+
</moduleInfoSource>
86+
</module>
87+
<overwriteExistingFiles>true</overwriteExistingFiles>
88+
</configuration>
89+
</execution>
90+
</executions>
91+
</plugin>
7292
</plugins>
7393
</build>
7494
</project>

vavr-match/pom.xml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.vavr</groupId>
55
<artifactId>vavr-parent</artifactId>
6-
<version>0.10.4</version>
6+
<version>0.10.5-SNAPSHOT</version>
77
<relativePath>../pom.xml</relativePath>
88
</parent>
99
<artifactId>vavr-match</artifactId>
@@ -24,13 +24,6 @@
2424
<plugin>
2525
<groupId>org.apache.maven.plugins</groupId>
2626
<artifactId>maven-jar-plugin</artifactId>
27-
<configuration>
28-
<archive>
29-
<manifestEntries>
30-
<Automatic-Module-Name>io.vavr.match</Automatic-Module-Name>
31-
</manifestEntries>
32-
</archive>
33-
</configuration>
3427
</plugin>
3528
<plugin>
3629
<groupId>org.apache.maven.plugins</groupId>
@@ -44,6 +37,30 @@
4437
<groupId>org.apache.felix</groupId>
4538
<artifactId>maven-bundle-plugin</artifactId>
4639
</plugin>
40+
<plugin>
41+
<groupId>org.moditect</groupId>
42+
<artifactId>moditect-maven-plugin</artifactId>
43+
<executions>
44+
<execution>
45+
<id>add-module-infos</id>
46+
<goals>
47+
<goal>add-module-info</goal>
48+
</goals>
49+
<phase>package</phase>
50+
<configuration>
51+
<jvmVersion>9</jvmVersion>
52+
<module>
53+
<moduleInfoSource>
54+
module io.vavr.match {
55+
exports io.vavr.match.annotation;
56+
}
57+
</moduleInfoSource>
58+
</module>
59+
<overwriteExistingFiles>true</overwriteExistingFiles>
60+
</configuration>
61+
</execution>
62+
</executions>
63+
</plugin>
4764
</plugins>
4865
</build>
4966
</project>

vavr-test/pom.xml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.vavr</groupId>
55
<artifactId>vavr-parent</artifactId>
6-
<version>0.10.4</version>
6+
<version>0.10.5-SNAPSHOT</version>
77
<relativePath>../pom.xml</relativePath>
88
</parent>
99
<artifactId>vavr-test</artifactId>
@@ -60,13 +60,6 @@
6060
<plugin>
6161
<groupId>org.apache.maven.plugins</groupId>
6262
<artifactId>maven-jar-plugin</artifactId>
63-
<configuration>
64-
<archive>
65-
<manifestEntries>
66-
<Automatic-Module-Name>io.vavr.test</Automatic-Module-Name>
67-
</manifestEntries>
68-
</archive>
69-
</configuration>
7063
</plugin>
7164
<plugin>
7265
<groupId>org.apache.maven.plugins</groupId>
@@ -76,6 +69,31 @@
7669
<groupId>org.apache.felix</groupId>
7770
<artifactId>maven-bundle-plugin</artifactId>
7871
</plugin>
72+
<plugin>
73+
<groupId>org.moditect</groupId>
74+
<artifactId>moditect-maven-plugin</artifactId>
75+
<executions>
76+
<execution>
77+
<id>add-module-infos</id>
78+
<goals>
79+
<goal>add-module-info</goal>
80+
</goals>
81+
<phase>package</phase>
82+
<configuration>
83+
<jvmVersion>9</jvmVersion>
84+
<module>
85+
<moduleInfoSource>
86+
module io.vavr.test {
87+
exports io.vavr.test;
88+
requires io.vavr;
89+
}
90+
</moduleInfoSource>
91+
</module>
92+
<overwriteExistingFiles>true</overwriteExistingFiles>
93+
</configuration>
94+
</execution>
95+
</executions>
96+
</plugin>
7997
</plugins>
8098
</build>
8199
</project>

vavr/pom.xml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.vavr</groupId>
55
<artifactId>vavr-parent</artifactId>
6-
<version>0.10.4</version>
6+
<version>0.10.5-SNAPSHOT</version>
77
<relativePath>../pom.xml</relativePath>
88
</parent>
99
<artifactId>vavr</artifactId>
@@ -75,13 +75,6 @@
7575
<plugin>
7676
<groupId>org.apache.maven.plugins</groupId>
7777
<artifactId>maven-jar-plugin</artifactId>
78-
<configuration>
79-
<archive>
80-
<manifestEntries>
81-
<Automatic-Module-Name>io.vavr</Automatic-Module-Name>
82-
</manifestEntries>
83-
</archive>
84-
</configuration>
8578
</plugin>
8679
<plugin>
8780
<groupId>org.apache.maven.plugins</groupId>
@@ -91,6 +84,34 @@
9184
<groupId>org.apache.felix</groupId>
9285
<artifactId>maven-bundle-plugin</artifactId>
9386
</plugin>
87+
<plugin>
88+
<groupId>org.moditect</groupId>
89+
<artifactId>moditect-maven-plugin</artifactId>
90+
<executions>
91+
<execution>
92+
<id>add-module-infos</id>
93+
<goals>
94+
<goal>add-module-info</goal>
95+
</goals>
96+
<phase>package</phase>
97+
<configuration>
98+
<jvmVersion>9</jvmVersion>
99+
<module>
100+
<moduleInfoSource>
101+
module io.vavr {
102+
exports io.vavr;
103+
exports io.vavr.collection;
104+
exports io.vavr.control;
105+
exports io.vavr.concurrent;
106+
requires io.vavr.match;
107+
}
108+
</moduleInfoSource>
109+
</module>
110+
<overwriteExistingFiles>true</overwriteExistingFiles>
111+
</configuration>
112+
</execution>
113+
</executions>
114+
</plugin>
94115
</plugins>
95116
</build>
96117
</project>

0 commit comments

Comments
 (0)