执行gradle时
- [root@bigdata01 kafka-0.10.0.0-src]# gradle
- Starting a Gradle Daemon (subsequent builds will be faster)
- Building project 'core' with Scala version 2.10.6
- FAILURE: Build failed with an exception.
- * Where:
- Build file '/opt/bigdata/kafka/kafka-0.10.0.0-src/build.gradle' line: 230
- * What went wrong:
- A problem occurred evaluating root project 'kafka-0.10.0.0-src'.
- > Failed to apply plugin [class 'org.gradle.api.plugins.scala.ScalaBasePlugin']
- > No such property: useAnt for class: org.gradle.api.tasks.scala.ScalaCompileOptions
- * Try:
- Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
- BUILD FAILED
- Total time: 22.997 secs
解决方法:vim kafka-0.10.0.0-src/build.gradle文件
添加如下行
- ScalaCompileOptions.metaClass.daemonServer = true
- ScalaCompileOptions.metaClass.fork = true
- ScalaCompileOptions.metaClass.useAnt = false
- ScalaCompileOptions.metaClass.useCompileDaemon = false
执行gradle idea时,报错
- FAILURE: Build failed with an exception.
- * Where:
- Build file '/opt/bigdata/kafka/kafka-0.10.0.0-src/build.gradle' line: 48
- * What went wrong:
- Could not compile build file '/opt/bigdata/kafka/kafka-0.10.0.0-src/build.gradle'.
- > startup failed:
- build file '/opt/bigdata/kafka/kafka-0.10.0.0-src/build.gradle': 48: unable to resolve class ComponentSelection
- @ line 48, column 19.
- rules.all { ComponentSelection selection ->
- ^
- 1 error
- * Try:
- Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
- BUILD FAILED
- Total time: 9.076 secs