Skip to content

Latest commit

 

History

History
54 lines (47 loc) · 1.54 KB

源码编译.md

File metadata and controls

54 lines (47 loc) · 1.54 KB

源码编译

0.9.0.1

记录0.9.0.1的编译过程

1、下载源码

2、安装gradle

# mac下
brew install gradle

3、修改build.gradle

> Failed to apply plugin [class 'org.gradle.api.plugins.scala.ScalaBasePlugin']  
   > No such property: useAnt for class: org.gradle.api.tasks.scala.ScalaCompileOptions

有相关报错需要修改build.gradle

ScalaCompileOptions.metaClass.daemonServer = true  
ScalaCompileOptions.metaClass.fork = true  
ScalaCompileOptions.metaClass.useAnt = false  
ScalaCompileOptions.metaClass.useCompileDaemon = false

4、gradle 执行一下gradle

5、配置代理(选)

6、打包编译

./gradlew releaseTarGz -x signArchives

2.2.0

问题1

需要注释掉build.gradle 393行。 (可能原因是spotbugs与gradle不太兼容,不过我们阅读源码也不是很需要这类bug检查工具)

//idea  tasks.withType(com.github.spotbugs.SpotBugsTask) {
//    reports {
//      // Continue supporting `xmlFindBugsReport` for compatibility
//      xml.enabled(project.hasProperty('xmlSpotBugsReport') || project.hasProperty('xmlFindBugsReport'))
//      html.enabled(!project.hasProperty('xmlSpotBugsReport') && !project.hasProperty('xmlFindBugsReport'))
//    }
//  }

问题2

A problem occurred evaluating root project 'kafka-2.2.0-src'.
> Cannot set the value of read-only property 'additionalSourceDirs' for task ':jacocoRootReport' of type org.gradle.testing.jacoco.tasks.JacocoReport.