最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時間:2021年10月20日 08:33:57   作者:偶爾發(fā)呆  
這篇文章主要介紹了使用 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. 將工程導入到 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 依賴,然后重新執(zhí)行  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 源碼環(huán)境的文章就介紹到這了,更多相關 idea 編譯 kafka 源碼內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

最新評論

宁武县| 贞丰县| 乌拉特前旗| 克什克腾旗| 石渠县| 原平市| 渝北区| 通江县| 缙云县| 桃园市| 潮州市| 东至县| 潮安县| 襄垣县| 湛江市| 潞西市| 辽宁省| 乐安县| 伊宁县| 陈巴尔虎旗| 罗定市| 沙雅县| 关岭| 杭锦后旗| 乳山市| 咸宁市| 忻城县| 淮滨县| 高密市| 七台河市| 开封县| 武宣县| 全州县| 浏阳市| 登封市| 调兵山市| 深泽县| 南充市| 乳山市| 司法| 南溪县|