【发布时间】:2015-09-18 16:21:47
【问题描述】:
我在 Ubuntu 14.04 LTS 上安装了 Spark 1.5。
使用命令build/mvn -Dscala-2.11 -DskipTests clean package 运行构建时,我在项目 Spark SQL 期间收到以下构建错误:
[error] missing or invalid dependency detected while loading class file 'WebUI.class'.
[error] Could not access term eclipse in package org,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[error] A full rebuild may help if 'WebUI.class' was compiled against an incompatible version of org.
[error] missing or invalid dependency detected while loading class file 'WebUI.class'.
[error] Could not access term jetty in value org.eclipse,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[error] A full rebuild may help if 'WebUI.class' was compiled against an incompatible version of org.eclipse.
[warn] 22 warnings found
[error] two errors found
[error] Compile failed at Sep 18, 2015 6:09:38 PM [17.330s]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Spark Project Parent POM ........................... SUCCESS [ 6.723 s]
[INFO] Spark Project Core ................................. SUCCESS [03:07 min]
...
[INFO] Spark Project Catalyst ............................. SUCCESS [ 58.166 s]
[INFO] Spark Project SQL .................................. FAILURE [ 19.912 s]
[INFO] Spark Project Hive ................................. SKIPPED
[INFO] Spark Project Unsafe ............................... SKIPPED
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
在文件.bashrc中我的环境变量下面
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
export SCALA_HOME=/usr/local/src/scala/scala-2.11.7
export PATH=$SCALA_HOME/bin:$PATH
export PATH=/home/ubuntu/apache-maven-3.3.3/bin:$PATH
export SPARK_HOME=/home/ubuntu/spark-1.5.0
export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512m"
更新:尝试使用 -Ylog-classpath 运行,但没有成功:
Unable to parse command line options: Unrecognized option: -Ylog-classpath
【问题讨论】:
-
我在 2.11 上尝试构建 spark 1.5 时遇到同样的错误,在 Building Spark 页面 (spark.apache.org/docs/1.5.0/building-spark.html) 上有一条注释“Spark 尚不支持其 Scala 2.11 的 JDBC 组件。”这可能是相关的。
-
@Angelo:你说得对,我在命令中省略了 -Dscala-2.11 选项,构建成功。谢谢!
-
如果您不使用 SQL 模块,您可能只需将其从顶级 pom 中注释掉并重新构建。不过我还没有测试过,所以 YMMV。
-
任何人都可以评论在路径中使用 mvn 的 spark 安装还是不同版本的 mvn 是否重要?我使用了后者并通过包含 Dscala-2.11(我最初没有使用)解决了这个问题
标签: maven build apache-spark apache-spark-sql