Kafka Source Reading Environment construction

Source: Internet
Author: User
Tags stack trace

1. Source Address

Http://archive.apache.org/dist/kafka/0.10.0.0/kafka-0.10.0.0-src.tgz

2. Environment Preparation

Centos

Gradle Download Address Https://services.gradle.org/distributions/gradle-3.1-bin.zip installation please refer here. Note To install version 3.1, you may get an error if you install version 1.1.

Scala

Java

3. Generate Idea Project file

Decompression kafka-0.10.0.0-src.tgz

Go to directory and execute Gradle idea



4. Questions:

Error when executing gradle idea

[Root@bigdata01 kafka-0.10.0.0-src]# gradle idea
starting a gradle Daemon (subsequent builds would be faster)
Buil Ding project ' core ' with the 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 C Lass: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

Workaround: Vim kafka-0.10.0.0-src/build.gradle file

Add as Downstream

ScalaCompileOptions.metaClass.daemonServer = True
ScalaCompileOptions.metaClass.fork = True
ScalaCompileOptions.metaClass.useAnt = False
ScalaCompileOptions.metaClass.useCompileDaemon = False



Error when executing 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, column.
             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

I previously installed the 1.1 version of Gradle. After switching to version 3.1, the problem is resolved.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.