1.kafka源码编译
发布日期:2021-07-30 03:26:37
浏览次数:2
分类:技术文章
本文共 4170 字,大约阅读时间需要 13 分钟。
kafka源码编译
1.准备环境
1.java环境
检查java版本,1.8java -version
2.scala环境
检查scala版本,2.11.8scala -version
3.gradle环境
检查gradle版本gradle -version
4.kafka
这里下载0.11.3,gradle版本也要选择低版本,4.10.2可以编译成功,5.6,6.8都编译失败
2.编译kafka
解压kafka-0.11.0.3-src.tgzF:\resources>cd kafka-0.11.0.3-srcF:\resources\kafka-0.11.0.3-src>gradle idea
1.报错信息1
F:\resources\kafka-0.11.0.3-src>gradle ideaFAILURE: Build failed with an exception.* Where:Build file 'F:\resources\kafka-0.11.0.3-src\build.gradle' line: 140* What went wrong:A problem occurred evaluating root project 'kafka-0.11.0.3-src'.> Plugin with id 'findbugs' not found.* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgDeprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warningsBUILD FAILED in 1s
提示kafka-0.11.0.3-src目录下build.gradle的140行,findbugs有问题
当前是6.8版本,更改版本为5.6 重新gradle idea2.报错信息2
Starting a Gradle Daemon (subsequent builds will be faster)> Configure project :Building project 'core' with Scala version 2.11.11FAILURE: Build failed with an exception.* Where:Build file 'F:\resources\kafka-0.11.0.3-src\build.gradle' line: 504* What went wrong:A problem occurred evaluating root project 'kafka-0.11.0.3-src'.> Failed to apply plugin [id 'org.scoverage'] > Could not create an instance of type org.scoverage.ScoverageExtension. > You can't map a property that does not exist: propertyName=testClassesDir* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgDeprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/5.6/userguide/command_line_interface.html#sec:command_line_warningsBUILD FAILED in 25s
提示504行org.scoverage
把 build.gradle 文件29行
classpath 'org.scoverage:gradle-scoverage:2.1.0'
2.1.0修改为2.5.0,再次执行gradle idea
3.报错信息3
> Configure project :Building project 'core' with Scala version 2.11.11FAILURE: Build failed with an exception.* Where:Build file 'F:\resources\kafka-0.11.0.3-src\build.gradle' line: 950* What went wrong:A problem occurred evaluating root project 'kafka-0.11.0.3-src'.> org.gradle.api.internal.java.JavaLibrary.(Lorg/gradle/api/artifacts/PublishArtifact;Lorg/gradle/api/artifacts/DependencySet;)V* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgDeprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/5.6/userguide/command_line_interface.html#sec:command_line_warningsBUILD FAILED in 6s
再次降低gradle版本,由5.6改为4.10.2,gradle-scoverage:2.5.0修改回来2.1.0
再次执行gradle idea> Configure project :Building project 'core' with Scala version 2.11.11> Task :ideaGenerated IDEA project at file:///F:/resources/kafka-0.11.0.3-src/kafka-0.11.0.3-src.iprDeprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warningsBUILD SUCCESSFUL in 7s21 actionable tasks: 21 executed
3.打开idea,导入kafka源码
1.File–setting里面设置gradle
2.File–setting–plugin,安装scala插件 3.File–open ,打开kafka源码目录kafka-0.11.0.3-src目录 | 说明 |
---|---|
bin | 启动脚本,启停KafkaServer,创建主题等 |
checkstyle | 代码检查配置 |
clients | 生产者和消费者代码,新版java语言开发 |
config | 运行相关配置 |
connect | Kafka Connect运用用户快速定义并实现各种Connector(File,Jdbc,Hdfs等),大批量数据导入导出方便 |
core | kafka服务实例的代码,scala语言开发,实现了集群管理,分区副本管理,消息存储和消息获取,网络通信等功能 |
docs | 文档 |
examples | 使用生产者消费者demo |
gradle | gradle构建相关 |
streams | kafka 流相关,替代storm等 |
tests | 测试脚本 |
tools | 工具类,查看生产者性能等 |
转载地址:https://blog.csdn.net/u010895512/article/details/118252866 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
留言是一种美德,欢迎回访!
[***.207.175.100]2024年03月31日 12时52分16秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
腾讯MSDK手Q微信授权登录
2019-04-27
腾讯MSDK for Unity
2019-04-27
关于MSDK的几个难点
2019-04-27
使用UnityEditor做工具
2019-04-27
Visual Studio我常用的快捷键
2019-04-27
写C# dll供Unity调用
2019-04-27
Linux制作run安装包
2019-04-27
一分钟学会C#解析XML
2019-04-27
unity AssetBundle的资源管理
2019-04-27
【转】Unity中HideInInspector和SerializeField一起使用
2019-04-27
单例模板类
2019-04-27
Unity与java相互调用
2019-04-27
android截屏代码
2019-04-27
unity NGUI图文混排
2019-04-27
Unity项目优化
2019-04-27
Unity3D Shader 入门
2019-04-27
eclipse识别不到真机设备问题的解决
2019-04-27
MSDK手Q邀请透传参数问题:url编解码与base64编解码
2019-04-27
svn提交的一个坑
2019-04-27
eclipse识别不了模拟器解决办法
2019-04-27