compile spark2.0.0 with maven

本文介绍如何安装配置 Spark 2.0.0 版本,并提供详细的步骤说明,包括 Maven 的配置及 Spark 相关插件的启用。此外还提供了针对 Debian GNU/Linux 特别是 8/jessie 版本的解决方案。
spark version : spark-2.0.0
maven : Apache Maven 3.5.0 

cd /usr/local/spark-2.0.0
1
export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512m"

Note:
For Java 8 and above this step is not required.
If using build/mvn with no MAVEN_OPTS set, the script will automate this for you.

2 
mvn -Pyarn -Phadoop-2.7 -Pspark-ganglia-lgpl -Pkinesis-asl -Phive -DskipTests clean package


3
./dev/make-distribution.sh --name custom-spark --tgz -Psparkr -Phadoop-2.7 -Phive -Phive-thriftserver -Pyarn

Note:
if you come across spark-core_2.11: Command execution failed
may be you should try some ways the following 
On Debian GNU/Linux (in particular 8/jessie) you would need to run 
apt-get install r-base r-base-dev
or 
aptitude install r-base r-base-dev
Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Spark 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Spark --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /data/workspace/myshixun/Spark/src/main/resources [INFO] [INFO] --- scala-maven-plugin:3.1.5:add-source (scala-compile-first) @ Spark --- [INFO] Add Source directory: /data/workspace/myshixun/Spark/src/main/scala [INFO] Add Test Source directory: /data/workspace/myshixun/Spark/src/test/scala [INFO] [INFO] --- scala-maven-plugin:3.1.5:compile (scala-compile-first) @ Spark --- [WARNING] Expected all dependencies to require Scala version: 2.11.8 [WARNING] com.twitter:chill_2.10:0.8.0 requires scala version: 2.10.5 [WARNING] Multiple versions of scala libraries detected! [INFO] /data/workspace/myshixun/Spark/src/main/scala:-1: info: compiling [INFO] Compiling 6 source files to /data/workspace/myshixun/Spark/target/classes at 1761898075413 [ERROR] /data/workspace/myshixun/Spark/src/main/scala/EduCoder1.scala:3: error: illegal character '\u200b' [ERROR] ​ [ERROR] ^ [ERROR] /data/workspace/myshixun/Spark/src/main/scala/EduCoder1.scala:14: error: illegal character '\u200b' [ERROR] ​ [ERROR] ^ [ERROR] /data/workspace/myshixun/Spark/src/main/scala/EduCoder1.scala:19: error: illegal character '\u200b' [ERROR] ​ [ERROR] ^ [ERROR] /data/workspace/myshixun/Spark/src/main/scala/EduCoder1.scala:21: error: illegal character '\u200b' [ERROR] ​ [ERROR] ^ [ERROR] /data/workspace/myshixun/Spark/src/main/scala/EduCoder1.scala:32: error: illegal character '\u200b' [ERROR] ​ [ERROR] ^ [ERROR] /data/workspace/myshixun/Spark/src/main/scala/EduCoder1.scala:34: error: illegal character '\u200b' [ERROR] ​ [ERROR] ^ [ERROR] 6 errors found [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 12.415 s [INFO] Finished at: 2025-10-31T08:07:57Z [INFO] Final Memory: 25M/832M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.1.5:compile (scala-compile-first) on project Spark: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
11-01
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值