Skip to content

Commit cff8961

Browse files
authored
Adds explicit Java module descriptor (#728)
Resolves #727 Signed-off-by: Andres Almiray <[email protected]>
1 parent a3eccdf commit cff8961

File tree

1 file changed

+59
-35
lines changed

1 file changed

+59
-35
lines changed

pom.xml

Lines changed: 59 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -186,41 +186,6 @@
186186
</instructions>
187187
</configuration>
188188
</plugin>
189-
<!--
190-
<plugin>
191-
<groupId>org.moditect</groupId>
192-
<artifactId>moditect-maven-plugin</artifactId>
193-
<version>1.0.0.RC1</version>
194-
<executions>
195-
<execution>
196-
<id>add-module-info</id>
197-
<phase>package</phase>
198-
<goals>
199-
<goal>add-module-info</goal>
200-
</goals>
201-
<configuration>
202-
<jvmVersion>9</jvmVersion>
203-
<module>
204-
<moduleInfoSource>
205-
module com.networknt.schema {
206-
requires transitive com.fasterxml.jackson.databind;
207-
requires org.apache.commons.lang3;
208-
requires org.jruby.jcodings;
209-
requires org.jruby.joni;
210-
requires org.slf4j;
211-
212-
exports com.networknt.schema;
213-
exports com.networknt.schema.format;
214-
exports com.networknt.schema.uri;
215-
exports com.networknt.schema.urn;
216-
}
217-
</moduleInfoSource>
218-
</module>
219-
</configuration>
220-
</execution>
221-
</executions>
222-
</plugin>
223-
-->
224189
<plugin>
225190
<groupId>org.sonatype.plugins</groupId>
226191
<artifactId>nexus-staging-maven-plugin</artifactId>
@@ -381,5 +346,64 @@
381346
</plugins>
382347
</build>
383348
</profile>
349+
<profile>
350+
<id>java-module</id>
351+
<activation>
352+
<jdk>[9,)</jdk>
353+
</activation>
354+
<build>
355+
<plugins>
356+
<plugin>
357+
<groupId>org.moditect</groupId>
358+
<artifactId>moditect-maven-plugin</artifactId>
359+
<version>1.0.0.RC3</version>
360+
<executions>
361+
<execution>
362+
<id>add-module-infos</id>
363+
<phase>package</phase>
364+
<goals>
365+
<goal>add-module-info</goal>
366+
</goals>
367+
<configuration>
368+
<jvmVersion>9</jvmVersion>
369+
<overwriteExistingFiles>true</overwriteExistingFiles>
370+
<module>
371+
<moduleInfo>
372+
<name>com.networknt.schema</name>
373+
<!-- export everything -->
374+
<exports>*;</exports>
375+
<!-- declare services consumed by the artifact -->
376+
<addServiceUses>true</addServiceUses>
377+
</moduleInfo>
378+
</module>
379+
<!--
380+
previously configured but commented out
381+
<module>
382+
<moduleInfoSource>
383+
module com.networknt.schema {
384+
requires transitive com.fasterxml.jackson.databind;
385+
requires org.apache.commons.lang3;
386+
requires org.jruby.jcodings;
387+
requires org.jruby.joni;
388+
requires org.slf4j;
389+
390+
exports com.networknt.schema;
391+
exports com.networknt.schema.format;
392+
exports com.networknt.schema.uri;
393+
exports com.networknt.schema.urn;
394+
}
395+
</moduleInfoSource>
396+
</module>
397+
-->
398+
<jdepsExtraArgs>
399+
<arg>--multi-release=9</arg>
400+
</jdepsExtraArgs>
401+
</configuration>
402+
</execution>
403+
</executions>
404+
</plugin>
405+
</plugins>
406+
</build>
407+
</profile>
384408
</profiles>
385409
</project>

0 commit comments

Comments
 (0)