【问题标题】:Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.2未能执行目标 net.alchim31.maven:scala-maven-plugin:3.2.2
【发布时间】:2023-03-27 01:01:01
【问题描述】:

编译 Maven 项目时出现以下错误:

[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

非常感谢任何帮助。

【问题讨论】:

  • 您是否尝试在本地编译 spark-streaming-flume-sink_2.10 ?你想达到什么目的?

标签: scala maven apache-spark zinc


【解决方案1】:

问题可能是这个[INFO] Using incremental compilation

在您的 pom.xml 中尝试删除行
<recompileMode>incremental</recompileMode>
然后再试一次。

【讨论】:

    【解决方案2】:

    我认为您正在使用 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
    

    希望这会有所帮助。

    【讨论】:

      【解决方案3】:

      奇怪的是 echo $JAVA_HOME 给出了一个空输出。在编译 Spakr 源时,我将 mvn clean 包成功项目导入到 eclipse 中,我遇到了同样的问题。我在这里找到了解决方案: How to solve “Plugin execution not covered by lifecycle configuration” for Spring Data Maven Builds

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-01-21
        • 1970-01-01
        • 1970-01-01
        • 2019-08-07
        • 2012-11-13
        • 2012-09-04
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多