Skip to content

Commit

Permalink
Full Java Platform Module System support for Java 9+ (#2846)
Browse files Browse the repository at this point in the history
As much as automatic modules do the job for now, jlink requires explicit module definition.
  • Loading branch information
pivovarit authored Oct 9, 2024
1 parent f86880f commit 27718c0
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 35 deletions.
10 changes: 8 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ We use these goals frequently to keep the dependencies and plugins up-to-date:
</parent>
<groupId>io.vavr</groupId>
<artifactId>vavr-parent</artifactId>
<version>0.10.4</version>
<version>0.10.5-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Vavr Parent</name>
<description>Vavr (formerly called Javaslang) is an object-functional language extension to Java 8+.</description>
Expand All @@ -49,7 +49,7 @@ We use these goals frequently to keep the dependencies and plugins up-to-date:
<connection>scm:git:[email protected]:vavr-io/vavr.git</connection>
<developerConnection>scm:git:[email protected]:vavr-io/vavr.git</developerConnection>
<url>[email protected]:vavr-io/vavr.git</url>
<tag>v0.10.4</tag>
<tag>HEAD</tag>
</scm>
<developers>
<developer>
Expand Down Expand Up @@ -86,6 +86,7 @@ We use these goals frequently to keep the dependencies and plugins up-to-date:
<maven.surefire.version>3.5.1</maven.surefire.version>
<maven.source.version>3.3.1</maven.source.version>
<maven.exec.version>3.4.1</maven.exec.version>
<moditect.version>1.2.2.Final</moditect.version>
<scala.maven.version>4.9.2</scala.maven.version>
<scala.version>3.5.1</scala.version>
</properties>
Expand Down Expand Up @@ -160,6 +161,11 @@ We use these goals frequently to keep the dependencies and plugins up-to-date:
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<version>${moditect.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion vavr-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.vavr</groupId>
<artifactId>vavr-parent</artifactId>
<version>0.10.4</version>
<version>0.10.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>vavr-benchmark</artifactId>
Expand Down
36 changes: 28 additions & 8 deletions vavr-match-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.vavr</groupId>
<artifactId>vavr-parent</artifactId>
<version>0.10.4</version>
<version>0.10.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>vavr-match-processor</artifactId>
Expand Down Expand Up @@ -53,13 +53,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.vavr.match.processor</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -69,6 +62,33 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<executions>
<execution>
<id>add-module-infos</id>
<goals>
<goal>add-module-info</goal>
</goals>
<phase>package</phase>
<configuration>
<jvmVersion>9</jvmVersion>
<module>
<moduleInfoSource>
module io.vavr.match.processor {
exports io.vavr.match;
exports io.vavr.match.generator;
exports io.vavr.match.model;
requires io.vavr.match;
}
</moduleInfoSource>
</module>
<overwriteExistingFiles>true</overwriteExistingFiles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
33 changes: 25 additions & 8 deletions vavr-match/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.vavr</groupId>
<artifactId>vavr-parent</artifactId>
<version>0.10.4</version>
<version>0.10.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>vavr-match</artifactId>
Expand All @@ -24,13 +24,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.vavr.match</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -44,6 +37,30 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<executions>
<execution>
<id>add-module-infos</id>
<goals>
<goal>add-module-info</goal>
</goals>
<phase>package</phase>
<configuration>
<jvmVersion>9</jvmVersion>
<module>
<moduleInfoSource>
module io.vavr.match {
exports io.vavr.match.annotation;
}
</moduleInfoSource>
</module>
<overwriteExistingFiles>true</overwriteExistingFiles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
34 changes: 26 additions & 8 deletions vavr-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.vavr</groupId>
<artifactId>vavr-parent</artifactId>
<version>0.10.4</version>
<version>0.10.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>vavr-test</artifactId>
Expand Down Expand Up @@ -60,13 +60,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.vavr.test</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -76,6 +69,31 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<executions>
<execution>
<id>add-module-infos</id>
<goals>
<goal>add-module-info</goal>
</goals>
<phase>package</phase>
<configuration>
<jvmVersion>9</jvmVersion>
<module>
<moduleInfoSource>
module io.vavr.test {
exports io.vavr.test;
requires io.vavr;
}
</moduleInfoSource>
</module>
<overwriteExistingFiles>true</overwriteExistingFiles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
37 changes: 29 additions & 8 deletions vavr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.vavr</groupId>
<artifactId>vavr-parent</artifactId>
<version>0.10.4</version>
<version>0.10.5-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>vavr</artifactId>
Expand Down Expand Up @@ -75,13 +75,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.vavr</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -91,6 +84,34 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<executions>
<execution>
<id>add-module-infos</id>
<goals>
<goal>add-module-info</goal>
</goals>
<phase>package</phase>
<configuration>
<jvmVersion>9</jvmVersion>
<module>
<moduleInfoSource>
module io.vavr {
exports io.vavr;
exports io.vavr.collection;
exports io.vavr.control;
exports io.vavr.concurrent;
requires io.vavr.match;
}
</moduleInfoSource>
</module>
<overwriteExistingFiles>true</overwriteExistingFiles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 27718c0

Please sign in to comment.