jzhuge commented on issue #24184: [SPARK-27250][test-maven][BUILD] Scala 2.11 maven compile should target Java 1.8 URL: https://github.com/apache/spark/pull/24184#issuecomment-475927641 Thanks @srowen. FWIW, I understand the SBT mystery a little better. Scale compile options come from maven `scala-maven-plugin.configuration.args` and the following code in SparkBuild.scala: ``` scalacOptions in Compile ++= Seq( s"-target:jvm-${javaVersion.value}", "-sourcepath", (baseDirectory in ThisBuild).value.getAbsolutePath // Required for relative source links in scaladoc ), ``` Evidence in the generated file `inc_compile-2.12`: ``` compile options: 12 items 00 -> -unchecked 01 -> -deprecation 02 -> -feature 03 -> -explaintypes 04 -> -Yno-adapted-args 05 -> -target:jvm-1.8.0_181 06 -> -P:genjavadoc:out=/Users/jzhuge/Repos/upstream-spark/common/network-yarn/target/java 07 -> -P:genjavadoc:strictVisibility=true 08 -> -Xplugin:/Users/jzhuge/.ivy2/cache/com.typesafe.genjavadoc/genjavadoc-plugin_2.12.8/jars/genjavadoc-plugin_2.12.8-0.11.jar 09 -> -target:jvm-1.8 10 -> -sourcepath 11 -> /Users/jzhuge/Repos/upstream-spark ``` The line `-target:jvm-${java.version}` in maven scalac args was parsed as `-target:jvm-1.8.0_191`, based on JVM system property, while the SparkBuild code set -target:jvm correctly because it got javaVersion from effective pom. It seems maven property `java.version` was not honored when extracting maven scalec options. @seancxmao Any insight?
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
