一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術(shù)|正則表達式|C/C++|IOS|C#|Swift|Android|VB|R語言|JavaScript|易語言|vb.net|

服務(wù)器之家 - 編程語言 - Java教程 - windows下使用 intellij idea 編譯 kafka 源碼環(huán)境

windows下使用 intellij idea 編譯 kafka 源碼環(huán)境

2022-02-23 00:49偶爾發(fā)呆 Java教程

這篇文章主要介紹了使用 intellij idea 編譯 kafka 源碼的環(huán)境,本文是基于windows下做的項目演示,需要的朋友可以參考下

1. 從 GitHub 網(wǎng)站,git clone kafka 源碼

2. 下載安裝好 gradle,scala

  2.1 從 dependencies.gradle 文件中找到 gradle 的版本,然后下載指定版本,并配置好 GRADLE_HOME 環(huán)境變量

3. 進入 kafka 項目目錄,依次執(zhí)行 gradle wrapper,gradle idea,gradle build --exclude-task test

4. 將工程導(dǎo)入到 idea

  4.1 啟動主類 kafka.Kafka

  4.2 program arguments:config/server.properties

  4.3 把 config 目錄下的 log4j.properties 拷貝到 core/src/main/resources 目錄

  4.4 File -> Project Structure -> Modules

5. 啟動程序

然而,大部分情況下,日志不會打印出來,配置一下 core 模塊的 log4j 依賴

找到 build.gradle 文件中的 project(":core"),修改對應(yīng)的 log4j 依賴,然后重新執(zhí)行  gradle idea,重新導(dǎo)入 idea 中

project(":core") {
  println "Building project "core" with Scala version ${versions.scala}"

  apply plugin: "scala"
  
  // scaladoc generation is configured at the sub-module level with an artifacts
  // block (cf. see streams-scala). If scaladoc generation is invoked explicitly
  // for the `core` module, this ensures the generated jar doesn"t include scaladoc
  // files since the `core` module doesn"t include public APIs.
  scaladoc {
    enabled = false
  }
  if (userEnableTestCoverage)
    apply plugin: "org.scoverage"
  archivesBaseName = "kafka_${versions.baseScala}"

  dependencies {
    compile project(":clients")
    compile project(":metadata")
    compile project(":raft")
    compile libs.argparse4j
    compile libs.jacksonDatabind
    compile libs.jacksonModuleScala
    compile libs.jacksonDataformatCsv
    compile libs.jacksonJDK8Datatypes
    compile libs.joptSimple
    compile libs.metrics
    compile libs.scalaCollectionCompat
    compile libs.scalaJava8Compat
    compile libs.scalaLibrary
    // only needed transitively, but set it explicitly to ensure it has the same version as scala-library
    compile libs.scalaReflect
    compile libs.scalaLogging
    compile libs.slf4jApi
    compile libs.slf4jlog4j
    compile libs.log4j

    compile(libs.zookeeper) {
//      exclude module: "slf4j-log4j12"
//      exclude module: "log4j"
    }
    // ZooKeeperMain depends on commons-cli but declares the dependency as `provided`
    compile libs.commonsCli

    compileOnly libs.log4j

    testCompile project(":clients").sourceSets.test.output
    testCompile libs.bcpkix
    testCompile libs.mockitoCore
    testCompile libs.easymock
    testCompile(libs.apacheda) {
      exclude group: "xml-apis", module: "xml-apis"
      // `mina-core` is a transitive dependency for `apacheds` and `apacheda`.
      // It is safer to use from `apacheds` since that is the implementation.
      exclude module: "mina-core"
    }
    testCompile libs.apachedsCoreApi
    testCompile libs.apachedsInterceptorKerberos
    testCompile libs.apachedsProtocolShared
    testCompile libs.apachedsProtocolKerberos
    testCompile libs.apachedsProtocolLdap
    testCompile libs.apachedsLdifPartition
    testCompile libs.apachedsMavibotPartition
    testCompile libs.apachedsJdbmPartition
    testCompile libs.junitJupiter
    testCompile libs.slf4jlog4j
    testCompile(libs.jfreechart) {
      exclude group: "junit", module: "junit"
    }
  }

目標就是把下圖的 log4j 依賴配置好。

windows下使用 intellij idea 編譯 kafka 源碼環(huán)境

windows下使用 intellij idea 編譯 kafka 源碼環(huán)境

到此這篇關(guān)于windows下使用 intellij idea 編譯 kafka 源碼環(huán)境的文章就介紹到這了,更多相關(guān) idea 編譯 kafka 源碼內(nèi)容請搜索服務(wù)器之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持服務(wù)器之家!

原文鏈接:https://www.cnblogs.com/allenwas3/p/9549915.html

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 国产三级精品三级男人的天堂 | 波多野结衣52部合集在线观看 | 久久久久久久电影 | 耽美双性 | 免费看黄色一级 | 日本熟hdx | 国产亚洲一欧美一区二区三区 | 国产成人免费观看在线视频 | 免费毛片在线观看 | 国产老熟 | 视频一区二区国产无限在线观看 | 国产精品1区2区 | 久久精品热在线观看85 | 爽好舒服宝贝添奶吻戏 | 欧美亚洲桃花综合 | 私人chinese beauty| 奇米影视亚洲狠狠色 | 国产综合久久 | 福利国模私拍视频在线观看 | 久久99re2在线视频精品 | 国产亚洲小视频 | 好男人资源免费播放 | 日本人成在线视频免费播放 | 国内精品视频一区二区三区 | 九九精品视频在线观看九九 | 日日艹| 特色特色大片在线 | 小小水蜜桃3视频在线观看 小鸟酱喷水 | 国产另类视频一区二区三区 | 嫩交18xxxx| 69日本xxxxxxxxx98 69人成网站色www | 鬼吹灯之天星术免费观看 | 国产一区在线 | 国产精品日韩欧美一区二区 | 国产精品反差婊在线观看 | 婷婷色六月| 色啪久久婷婷综合激情 | 国产剧情一区二区三区 | 60岁妇女毛片免费观看 | 2019国内自拍大神视频 | 国产伦码精品一区二区 |