激情久久久_欧美视频区_成人av免费_不卡视频一二三区_欧美精品在欧美一区二区少妇_欧美一区二区三区的

服務器之家:專注于服務器技術及軟件下載分享
分類導航

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

服務器之家 - 編程語言 - Java教程 - windows下使用 intellij idea 編譯 kafka 源碼環境

windows下使用 intellij idea 編譯 kafka 源碼環境

2022-02-23 00:49偶爾發呆 Java教程

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

1. 從 GitHub 網站,git clone kafka 源碼

2. 下載安裝好 gradle,scala

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

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

4. 將工程導入到 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"),修改對應的 log4j 依賴,然后重新執行  gradle idea,重新導入 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 源碼環境

windows下使用 intellij idea 編譯 kafka 源碼環境

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

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

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 亚洲一区在线免费视频 | 久久影城| 黄色片免费看看 | 在线日韩av电影 | 97超级碰碰人国产在线观看 | 久久精品视频一区二区三区 | 国产中出视频 | 精品一区二区三区在线观看视频 | 久久国产精品久久久久久 | 亚洲一区国产二区 | 欧美一级成人 | 91视频成人入口 | 日本中文一级片 | 日日草夜夜 | 国内精品久久久久久久影视红豆 | 黄色毛片免费视频 | 欧美aⅴ视频| 中文在线观看免费视频 | 羞羞视频.www在线观看 | 九九黄色影院 | 国产精品久久久久免费视频 | 色视频在线播放 | 欧美a欧美 | 色网在线视频 | 久久国产一级片 | 性色av一区二区三区在线观看 | 国产高潮好爽受不了了夜色 | 91在线视频精品 | 欧美日韩亚洲不卡 | 4480午夜 | 久久久久国产成人精品亚洲午夜 | 久久大陆 | 91福利免费观看 | 99精品视频一区二区 | 国产精品麻豆一区二区三区 | 欧美成人免费小视频 | 欧美日韩视频网站 | 九九热精品免费 | 亚洲第一男人天堂 | 久久丝袜脚交足黄网站免费 | 成年人国产视频 |