---
title: "kafka源码编译"
author: "blackproof"
date: "2015-06-06T14:11:36Z"
tags: ["Eclipse", "kafka"]
categories: ["企业架构"]
slug: "kafka"
draft: false
lastmod: "2015-10-09T17:09:39Z"
id: 2217055
url: "https://blackproof.iteye.com/blog/2217055"
---

git clone http://git-wip-us.apache.org/repos/asf/kafka.git D:\\git\\kafka

 

https://kafka.apache.org/downloads.html

 

 安装gradle

 

 到kafka目录下

 

 运行gradle wrapper，解决找不到类

 If you just checked out the code, you don't have the gradle wrapper library and you'll get an error message after running \`./gradlew\`:

"Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain"

To fix it you need to run \`gradle wrapper\` first which will download the gradle wrapper (you need to have gradle &gt;= 1.7 installed locally).

 

运行

./gradlew eclipse

 

gradle idea

 

 gradle build -x test

其中的-x test表示跳过unit test

 

https://cwiki.apache.org/confluence/display/KAFKA/Developer+Setup

https://docs.gradle.org/current/userguide/gradle\_wrapper.html