Repository: spark Updated Branches: refs/heads/branch-2.0 07a914c09 -> 0408793aa
[SPARK-15839] Fix Maven doc-jar generation when JAVA_7_HOME is set ## What changes were proposed in this pull request? It looks like the nightly Maven snapshots broke after we set `JAVA_7_HOME` in the build: https://amplab.cs.berkeley.edu/jenkins/view/Spark%20Packaging/job/spark-master-maven-snapshots/1573/. It seems that passing `-javabootclasspath` to ScalaDoc using scala-maven-plugin ends up preventing the Scala library classes from being added to scalac's internal class path, causing compilation errors while building doc-jars. There might be a principled fix to this inside of the scala-maven-plugin itself, but for now this patch configures the build to omit the `-javabootclasspath` option during Maven doc-jar generation. ## How was this patch tested? Tested manually with `build/mvn clean install -DskipTests=true` when `JAVA_7_HOME` was set. Also manually inspected the effective POM diff to verify that the final POM changes were scoped correctly: https://gist.github.com/JoshRosen/f889d1c236fad14fa25ac4be01654653 /cc vanzin and yhuai for review. Author: Josh Rosen <[email protected]> Closes #13573 from JoshRosen/SPARK-15839. (cherry picked from commit 6cb71f4733a920d916b91c66bb2a508a21883b16) Signed-off-by: Yin Huai <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/0408793a Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/0408793a Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/0408793a Branch: refs/heads/branch-2.0 Commit: 0408793aaab177920363913c9e91ac3af695370a Parents: 07a914c Author: Josh Rosen <[email protected]> Authored: Thu Jun 9 12:32:29 2016 -0700 Committer: Yin Huai <[email protected]> Committed: Thu Jun 9 12:33:00 2016 -0700 ---------------------------------------------------------------------- pom.xml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/0408793a/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 0419896..7f9ea44 100644 --- a/pom.xml +++ b/pom.xml @@ -2605,12 +2605,29 @@ <plugin> <groupId>net.alchim31.maven</groupId> <artifactId>scala-maven-plugin</artifactId> - <configuration> - <args combine.children="append"> - <arg>-javabootclasspath</arg> - <arg>${env.JAVA_7_HOME}/jre/lib/rt.jar</arg> - </args> - </configuration> + <!-- Note: -javabootclasspath is set on a per-execution basis rather than as a + plugin-wide configuration because doc-jar generation will break if it's + set; see SPARK-15839 for more details --> + <executions> + <execution> + <id>scala-compile-first</id> + <configuration> + <args combine.children="append"> + <arg>-javabootclasspath</arg> + <arg>${env.JAVA_7_HOME}/jre/lib/rt.jar</arg> + </args> + </configuration> + </execution> + <execution> + <id>scala-test-compile-first</id> + <configuration> + <args combine.children="append"> + <arg>-javabootclasspath</arg> + <arg>${env.JAVA_7_HOME}/jre/lib/rt.jar</arg> + </args> + </configuration> + </execution> + </executions> </plugin> </plugins> </pluginManagement> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
