Apache kafka編譯java
前言git
github網站kafka項目的README.md有關於kafka源碼編譯的說明github
github地址:https://github.com/apache/kafkaexpress
編譯環境準備 java maven gradleapache
編譯app
失敗緣由:gradle版本過高,下降到4.8就ok了less
編譯(執行以下命令)jvm
會在kafka/core/build/distributions目錄下生成須要的tar包maven
CDH kafka編譯gradle
源碼仍是從github獲取
git clone https://github.com/cloudera/kafka.git
注意:修改gradle.properties中的mavenUrl,由於maven.jenkins.cloudera.com是私有的,須要改爲公有的
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. group=org.apache.kafka # NOTE: When you change this version number, you should also make sure to update # the version numbers in tests/kafkatest/__init__.py and kafka-merge-pr.py. cdhversion=6.1.0 version=2.0.0-cdh6.1.0 scalaVersion=2.11.12 task=build org.gradle.jvmargs=-Xmx1024m -Xss2m
mavenUrl=https://repository.cloudera.com/artifactory/cloudera-repos #http://maven.jenkins.cloudera.com:8081/artifactory/cdh-snapshot-local
mavenSnapshotUrl=http://maven.jenkins.cloudera.com:8081/artifactory/cdh-snapshot-local mavenArtifactoryUrl=http://maven.jenkins.cloudera.com:8081/artifactory/cloudera-mirrors mavenUsername= mavenPassword=
以後的編譯過程參考apache kafka編譯打包命令!
結果: