激情久久久_欧美视频区_成人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 | 成人三级免费电影 | 91网站永久免费看 | 激情在线免费观看 | 国产真实孩交 | 91在线免费观看 | 国产a级久久 | 国产精品久久久久久久久粉嫩 | 国产1区2区在线 | 九九热在线免费观看视频 | 亚洲午夜免费电影 | 精品一区二区三区在线播放 | 久久国产精品系列 | 免费的性爱视频 | 操碰 | 2019天天干夜夜操 | 99综合视频 | 亚洲成人中文字幕在线 | 黄视频免费在线观看 | 国产一区二区午夜 | 亚洲综合视频网 | 久草久视频 | 免费a视频| 毛片免费视频播放 | 在线观看免费毛片视频 | 精品人伦一区二区三区蜜桃网站 | 一二区成人影院电影网 | 国产精品久久久久久久久久东京 | 久草成人在线观看 | 中文字幕亚洲情99在线 | 久久精品视频1 | 久久久一区二区 | 久久亚洲春色中文字幕久久 | 精品呦女 | 亚洲午夜免费电影 | 色中色在线视频 | 亚洲成人免费视频在线 | 九九热视频免费观看 | 精品一区二区三区欧美 |