From 937a74e6e71ad8a6495e8285e2a70f90b6b8127b Mon Sep 17 00:00:00 2001 From: Chao Sun Date: Sun, 26 Sep 2021 13:39:36 +0800 Subject: [PATCH] [SPARK-36835][FOLLOWUP][BUILD][TEST-HADOOP2.7] Fix maven issue for Hadoop 2.7 profile after enabling dependency reduced pom ### What changes were proposed in this pull request? Fix an issue where Maven may stuck in an infinite loop when building Spark, for Hadoop 2.7 profile. ### Why are the changes needed? After re-enabling `createDependencyReducedPom` for `maven-shade-plugin`, Spark build stopped working for Hadoop 2.7 profile and will stuck in an infinitely loop, likely due to a Maven shade plugin bug similar to https://issues.apache.org/jira/browse/MSHADE-148. This seems to be caused by the fact that, under `hadoop-2.7` profile, variable `hadoop-client-runtime.artifact` and `hadoop-client-api.artifact`are both `hadoop-client` which triggers the issue. As a workaround, this changes `hadoop-client-runtime.artifact` to be `hadoop-yarn-api` when using `hadoop-2.7`. Since `hadoop-yarn-api` is a dependency of `hadoop-client`, this essentially moves the former to the same level as the latter. It should have no effect as both are dependencies of Spark. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? N/A Closes #34100 from sunchao/SPARK-36835-followup. Authored-by: Chao Sun Signed-off-by: Gengliang Wang --- pom.xml | 24 ++++++++++++++++++++---- resource-managers/yarn/pom.xml | 24 ++++++++++++------------ 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index 2cece056b1..bd02fd25a7 100644 --- a/pom.xml +++ b/pom.xml @@ -249,9 +249,22 @@ test hadoop-client-api hadoop-client-runtime @@ -3272,8 +3285,11 @@ 2.7.4 2.7.1 2.4 + hadoop-client - hadoop-client + hadoop-yarn-api hadoop-client diff --git a/resource-managers/yarn/pom.xml b/resource-managers/yarn/pom.xml index d6f7eabf98..12a600fa0e 100644 --- a/resource-managers/yarn/pom.xml +++ b/resource-managers/yarn/pom.xml @@ -82,6 +82,18 @@ true + + org.apache.hadoop + ${hadoop-client-runtime.artifact} + ${hadoop.version} + ${hadoop.deps.scope} + + + org.apache.hadoop + ${hadoop-client-minicluster.artifact} + ${hadoop.version} + test + org.bouncycastle @@ -127,18 +139,6 @@ ${hadoop-client-api.artifact} ${hadoop.version} - - org.apache.hadoop - ${hadoop-client-runtime.artifact} - ${hadoop.version} - ${hadoop.deps.scope} - - - org.apache.hadoop - ${hadoop-client-minicluster.artifact} - ${hadoop.version} - test -