Scaladocs构建失败kafka

时间:2015-07-23 05:31:25

标签: gradle build.gradle apache-kafka

我正在尝试使用gradle从源代码构建Apache kafka,但是我无法让scaladocs构建。以下是相同的错误日志:

 == Expanded type of tree ==

ConstantType(value = Constant(kafka.utils.timer.TimerTaskList))

uncaught exception during compilation: java.io.IOException
File name too long
two errors found
:core:compileScala FAILED
:core:compileScala (Thread[Daemon worker,5,main]) completed. Took 1 mins 4.416 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':core:compileScala'.
> Compilation failed

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 13.736 secs
Stopped 1 compiler daemon(s).
Received result 

CommandFailure[value=org.gradle.launcher.exec.ReportedException:org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':core:compileScala'.] from daemon DaemonInfo{pid=5656, address=[4d0d3e79-f94a-43ca-b183-792d2bfe1a95 port:55666, addresses:[/0:0:0:0:0:0:0:1%1, /127.0.0.1]], idle=false, context=DefaultDaemonContext[uid=1f1f4b55-9da9-4283-b361-8b0bfce3f208,javaHome=/usr/lib/jvm/java-7-oracle,daemonRegistryDir=/home/akshat/.gradle/daemon,pid=5656,idleTimeout=120000,daemonOpts=-XX:MaxPermSize=512m,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=IN,-Duser.language=en,-Duser.variant]}.  

虽然我怀疑这是一个记忆问题,但我没有看到任何改变它的地方。我在这里尝试编辑:

tasks.withType(ScalaCompile) {
    scalaCompileOptions.useAnt = false

    configure(scalaCompileOptions.forkOptions) {
      memoryMaximumSize = '1g'
      jvmArgs = ['-XX:MaxPermSize=512m']
    }
  }
}

但它没有帮助。

2 个答案:

答案 0 :(得分:0)

是的,这可能与Gradle内存设置有关。您可以通过设置环境变量set GRADLE_OPTS=-Xmx1024m(Windows)来增加Gradle堆,它可能会更好。

答案 1 :(得分:0)

错误是由于我的主文件夹被加密引起的。似乎kafka在加密文件夹中安装时遇到问题。我不得不重新安装ubuntu来解决这个问题。没有其他选择。