2016-04-15 728 views
2

在编译Maven项目出现下列错误:未能net.alchim31.maven执行目标:斯卡拉,Maven的插件:3.2.2

[INFO] --- scala-maven-plugin:3.2.2:compile (scala-compile-first) @ spark-streaming-flume-sink_2.10 --- 
[WARNING] Zinc server is not available at port 3030 - reverting to normal incremental compile 
[INFO] Using incremental compilation 
[INFO] Compiling 6 Scala sources and 3 Java sources to /home/gorlec/Desktop/test/external/flume-sink/target/scala-2.10/classes... 
[ERROR] /home/gorlec/Desktop/test/external/flume-sink/src/main/scala/org/apache/spark/streaming/flume/sink/SparkAvroCallbackHandler.scala:47: identifier expected but 'with' found. 
[ERROR] with Logging { 
[ERROR]^
[ERROR] one error found 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 7.992s 
[INFO] Finished at: Fri Apr 15 17:44:33 CEST 2016 
[INFO] Final Memory: 25M/350M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.2:compile (scala-compile-first) on project spark-streaming-flume-sink_2.10: Execution scala-compile-first of goal net.alchim31.maven:scala-maven-plugin:3.2.2:compile failed. CompileFailed -> 
[Help 1] 
[ERROR] 

我删除从pom.xml的财产<useZincServer>true</useZincServer>,和仍然记录错误仍然存​​在。

[INFO] --- scala-maven-plugin:3.2.2:compile (scala-compile-first) @ spark-streaming-flume-sink_2.10 --- 
[INFO] Using incremental compilation 
[INFO] Compiling 6 Scala sources and 3 Java sources to /home/gorlec/Desktop/test/external/flume-sink/target/scala-2.10/classes... 
[ERROR] /home/gorlec/Desktop/test/external/flume-sink/src/main/scala/org/apache/spark/streaming/flume/sink/SparkAvroCallbackHandler.scala:47: identifier expected but 'with' found. 
[ERROR] with Logging { 
[ERROR]^
[ERROR] one error found 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 5.814s 
[INFO] Finished at: Fri Apr 15 17:41:00 CEST 2016 
[INFO] Final Memory: 25M/335M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.2:compile (scala-compile-first) on project spark-streaming-flume-sink_2.10: Execution scala-compile-first of goal net.alchim31.maven:scala-maven-plugin:3.2.2:compile failed. CompileFailed -> 
[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. 

我检查了PATHJAVA_HOME~/.bashrc定义如下:

export PATH=$PATH:/usr/lib/jvm/java-7-openjdk-amd64/bin 
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 

,我注意到的唯一问题是echo $JAVA_HOME给出了一个空的输出,虽然我没有source ~/.bashrc

任何帮助,高度赞赏。

+0

你想在本地编译spark-streaming-flume-sink_2.10吗? 你想达到什么目的? – Vishnu667

回答

0

我想你是用Scala 2.10编译Spark的。如果是这样,你应该这样做。

cd /path/to/Spark 
./dev/change-scala-version.sh 2.10 
./build/mvn -Pyarn -Phadoop-2.4 -Dscala-2.10 -DskipTests clean package 

希望这会有所帮助。

相关问题