kafka源码导入IDEA,用gradle idea转换失败!世界未解之谜

问题:gradle idea执行出错!无法转换kafka源码为IDEA格式

Build file ‘D:\kafka-0.10.0.1-src\kafka-0.10.0.1-src\build.gradle’ line: 288

A problem occurred evaluating root project ‘kafka-0.10.0.1-src’.

Cannot set the value of read-only property ‘additionalSourceDirs’ for task ‘:jacocoRootReport’ of type org.gradle.testing.jacoco.tasks.JacocoReport.

解决方法

思考了一下,Kafka源码打包的时候用的肯定是当时对应的Gradle版本!So
选用源码里build.gradle文件了的gradleVersion对应的版本即可!

kafka 0.10.0.1版本对应的是gradle2.13 版本
执行gradle idea成功!


```bash
D:\>cd D:\kafka-0.10.0.1-src\kafka-0.10.0.1-src

D:\kafka-0.10.0.1-src\kafka-0.10.0.1-src>gradle idea
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.13/userguide/gradle_daemon.html.
Building project 'core' with Scala version 2.10.6
Build file 'D:\kafka-0.10.0.1-src\kafka-0.10.0.1-src\build.gradle': line 233
useAnt has been deprecated and is scheduled to be removed in Gradle 3.0. The Ant-Based Scala compiler is deprecated, please see 
......
Download https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.6.3/jackson-core-2.6.3.jar
Download https://repo1.maven.org/maven2/org/rocksdb/rocksdbjni/4.8.0/rocksdbjni-4.8.0-sources.jar
Download https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.6.3/jackson-databind-2.6.3-sources.jar
Download https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.6.0/jackson-annotations-2.6.0-sources.jar
Download https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.6.3/jackson-core-2.6.3-sources.jar
:streams:idea
:tools:ideaModule
Download https://repo1.maven.org/maven2/net/sourceforge/argparse4j/argparse4j/0.5.0/argparse4j-0.5.0.pom
......
Download https://repo1.maven.org/maven2/org/glassfish/hk2/external/aopalliance-repackaged/2.4.0-b34/aopalliance-repackaged-2.4.0-b34-sources.jar
:connect:runtime:idea
:streams:examples:ideaModule
:streams:examples:idea

BUILD SUCCESSFUL

Total time: 40 mins 23.427 secs

机智如我!哈哈哈

最后,会产生所需文件,如下:
在这里插入图片描述

But问题二又来了!IDEA版本不兼容

The project uses Gradle 2.13 which is incompatible with IDEA running on Java 10 or newer.
See details at https://github.com/gradle/gradle/issues/8431
Possible solution:

  • Upgrade Gradle wrapper to 4.8.1 version and re-import the project
说这高贵的IDEA现在是用Jdk10或更高版本,看不起我们JDK1.8,所以你这gradle用1.8不行,我们不兼容!呵呵!

然后,有个大神公布了下一步的办法:

用IDEA的Choose Runtime插件,生成IDEA对应的JDK1.8环境

https://blog.csdn.net/jiajane/article/details/103014036

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值