Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Incomplete
-
2.3.0
-
None
-
maven + jdk9 + project based on jdk9 module system
Description
When adding Spark to a Java 9 project that is utilizing the new jdk9 module system, Spark components cannot be used because the automatic module names that are generated by the jdk9 fail if the artifact has digits in what would become the beginning of an identifier. The jdk cannot generate an automatic name for the Spark module, resulting in Spark being unusable from within a java module.
This problem can also be validated/tested on the command line against any Spark jar, e.g.
Unable to derive module descriptor for: spark-graphx_2.11-2.3.0.jar spark.graphx.2.11: Invalid module name: '2' is not a Java identifier
Spark does not have to support jdk9 modules to fix this issue. It just needs to add a line of metadata to its manifest so the jdk can generate a valid automatic name.
the following would be sufficient to fix the issue in spark.graphx
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifestEntries> <Automatic-Module-Name>spark.graphx</Automatic-Module-Name> </manifestEntries> </archive> </configuration> </plugin>