From 9256e3ed52e0f7ba77e429a15118fef22a2f6960 Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Thu, 22 Aug 2024 16:10:11 +0200 Subject: [PATCH] Declarative JPMS descriptors (#879) Motivation: tcnative should provide declarative modules for the set of its artifacts. This is a preliminary contribution that will enable the support of declarative JPMS descriptors for Netty 4.2 branch. Modifications: Generated artifacts are multi release jar to remain compatible with Java 8. Result: This has been tested with `netty-tcnative-openssl-static` on my arm64 mac with a jlink generated image. --- boringssl-static/pom.xml | 12 +++---- libressl-static/pom.xml | 4 +-- openssl-classes/src/main/java/module-info.yml | 2 ++ openssl-dynamic/pom.xml | 4 +-- openssl-static/pom.xml | 4 +-- pom.xml | 32 ++++++++++++++++++- 6 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 openssl-classes/src/main/java/module-info.yml diff --git a/boringssl-static/pom.xml b/boringssl-static/pom.xml index ff7060f1..0ba6d49f 100644 --- a/boringssl-static/pom.xml +++ b/boringssl-static/pom.xml @@ -63,7 +63,7 @@ -L${boringsslHome}/ssl -L${boringsslHome}/crypto -lssl -lcrypto true - ${javaModuleNameNative} + ${javaDefaultModuleName} @@ -277,7 +277,7 @@ - + @@ -555,7 +555,7 @@ - + @@ -890,7 +890,7 @@ - + @@ -1309,7 +1309,7 @@ - + @@ -1556,7 +1556,7 @@ - + diff --git a/libressl-static/pom.xml b/libressl-static/pom.xml index 7c6acab5..30f71423 100644 --- a/libressl-static/pom.xml +++ b/libressl-static/pom.xml @@ -40,7 +40,7 @@ true true - ${javaModuleNameNative} + ${javaDefaultModuleName} @@ -112,7 +112,7 @@ - + diff --git a/openssl-classes/src/main/java/module-info.yml b/openssl-classes/src/main/java/module-info.yml new file mode 100644 index 00000000..56a03404 --- /dev/null +++ b/openssl-classes/src/main/java/module-info.yml @@ -0,0 +1,2 @@ +exports: + - package: io.netty.internal.tcnative diff --git a/openssl-dynamic/pom.xml b/openssl-dynamic/pom.xml index fb4b7152..c76b5e67 100644 --- a/openssl-dynamic/pom.xml +++ b/openssl-dynamic/pom.xml @@ -36,7 +36,7 @@ true - ${javaModuleNameNative} + ${javaDefaultModuleName} @@ -77,7 +77,7 @@ - + diff --git a/openssl-static/pom.xml b/openssl-static/pom.xml index 485ccb3b..fb6b0fdb 100644 --- a/openssl-static/pom.xml +++ b/openssl-static/pom.xml @@ -39,7 +39,7 @@ true true - ${javaModuleNameNative} + ${javaDefaultModuleName} @@ -109,7 +109,7 @@ - + diff --git a/pom.xml b/pom.xml index 3beb8a36..aa1153ed 100644 --- a/pom.xml +++ b/pom.xml @@ -233,6 +233,36 @@ + + io.github.dmlloyd.module-info + module-info + 2.1 + + + default-jar-module-info + process-classes + + ${javaModuleName} + ${project.build.outputDirectory}/META-INF/versions/11/ + + + generate + + + + native-jar-module-info + process-classes + + ${javaModuleNameNative} + ${nativeJarWorkdir}//META-INF/versions/11/ + + + generate + + + + + maven-surefire-plugin 2.22.2 @@ -439,7 +469,7 @@ true - ${javaModuleName} + true true ${project.build.outputDirectory}/META-INF/MANIFEST.MF