F:\storm\day01-kafka\kafka-0.8.2.0-src

执行gradle时

[plain]  view plain  copy
  1. [root@bigdata01 kafka-0.10.0.0-src]# gradle
  2. Starting a Gradle Daemon (subsequent builds will be faster)  
  3. Building project 'core' with Scala version 2.10.6  
  4.   
  5. FAILURE: Build failed with an exception.  
  6.   
  7. * Where:  
  8. Build file '/opt/bigdata/kafka/kafka-0.10.0.0-src/build.gradle' line: 230  
  9.   
  10. * What went wrong:  
  11. A problem occurred evaluating root project 'kafka-0.10.0.0-src'.  
  12. > Failed to apply plugin [class 'org.gradle.api.plugins.scala.ScalaBasePlugin']  
  13.    > No such property: useAnt for class: org.gradle.api.tasks.scala.ScalaCompileOptions  
  14.   
  15. * Try:  
  16. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.  
  17.   
  18. BUILD FAILED  
  19.   
  20. Total time: 22.997 secs  

解决方法:vim kafka-0.10.0.0-src/build.gradle文件

添加如下行

[plain]  view plain  copy
  1. ScalaCompileOptions.metaClass.daemonServer = true  
  2. ScalaCompileOptions.metaClass.fork = true  
  3. ScalaCompileOptions.metaClass.useAnt = false  
  4. ScalaCompileOptions.metaClass.useCompileDaemon = false  



执行gradle idea时,报错

[plain]  view plain  copy
  1. FAILURE: Build failed with an exception.  
  2.   
  3. * Where:  
  4. Build file '/opt/bigdata/kafka/kafka-0.10.0.0-src/build.gradle' line: 48  
  5.   
  6. * What went wrong:  
  7. Could not compile build file '/opt/bigdata/kafka/kafka-0.10.0.0-src/build.gradle'.  
  8. > startup failed:  
  9.   build file '/opt/bigdata/kafka/kafka-0.10.0.0-src/build.gradle': 48: unable to resolve class ComponentSelection   
  10.    @ line 48, column 19.  
  11.              rules.all { ComponentSelection selection ->  
  12.                        ^  
  13.     
  14.   1 error  
  15.   
  16.   
  17. * Try:  
  18. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.  
  19.   
  20. BUILD FAILED  
  21.   
  22. Total time: 9.076 secs  

猜你喜欢

转载自blog.csdn.net/zyq11223/article/details/78949988