[ 
https://issues.apache.org/jira/browse/SPARK-23543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brian D Chambers updated SPARK-23543:
-------------------------------------
    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.
{panel:title=jar --file=spark-graphx_2.11-2.3.0.jar --describe-module}
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
{panel}
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
{code:java}
<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>
{code}
 

  was:
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 are based on the JAR.  When the JAR has chars not 
recognized by jdk9 as valid for identifiers (in this case, digits) at the start 
of a part of the token, the jdk9 fails to autogenerate a module name.

This problem can also be validated/tested on the command line against any Spark 
jar, e.g.
{panel:title=jar --file=spark-graphx_2.11-2.3.0.jar --describe-module}
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
{panel}
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
{code:java}
<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>
{code}
 


> Automatic Module creation fails in Java 9
> -----------------------------------------
>
>                 Key: SPARK-23543
>                 URL: https://issues.apache.org/jira/browse/SPARK-23543
>             Project: Spark
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 2.3.0
>         Environment: maven + jdk9 + project based on jdk9 module system
>            Reporter: Brian D Chambers
>            Priority: Major
>
> 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.
> {panel:title=jar --file=spark-graphx_2.11-2.3.0.jar --describe-module}
> 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
> {panel}
> 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
> {code:java}
> <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>
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to