当前位置:   article > 正文

kafka gradlew编译环境搭建_gradlew jarall

gradlew jarall
  1. kafka源码编译
  2. java -version #必须先安装jdk
  3. brew install gradle安装的为gradle-5.0-bin.zip #MAC系统需要安装gradle
  4. 安装完成之后没有gradlew 命令
  5. https://downloads.gradle.org/distributions/gradle-5.0-all.zip
  6. 查找gradlew可执行文件
  7. .//gradle-5.0/samples/userguide/wrapper/sha256-verification/gradlew
  8. gradlew拷贝到kafka目录下
  9. 然后编译测试
  10. zhangjinyudeMacBook-Pro:Downloads zhangjinyu$ cd kafka
  11. Build a jar and run it
  12. zhangjinyudeMacBook-Pro:kafka zhangjinyu$ ./gradlew jar
  13. Build source jar
  14. zhangjinyudeMacBook-Pro:kafka zhangjinyu$ ./gradlew srcJar
  15. Build aggregated javadoc
  16. zhangjinyudeMacBook-Pro:kafka zhangjinyu$ ./gradlew aggregatedJavadoc
  17. Build javadoc and scaladoc
  18. ./gradlew javadoc
  19. ./gradlew javadocJar # builds a javadoc jar for each module
  20. ./gradlew scaladoc
  21. ./gradlew scaladocJar # builds a scaladoc jar for each module
  22. ./gradlew docsJar # builds both (if applicable) javadoc and scaladoc jars for each module
  23. Run unit/integration tests
  24. ./gradlew test # runs both unit and integration tests
  25. ./gradlew unitTest
  26. ./gradlew integrationTest
  27. Force re-running tests without code change
  28. ./gradlew cleanTest test
  29. ./gradlew cleanTest unitTest
  30. ./gradlew cleanTest integrationTest
  31. Running a particular unit/integration test
  32. ./gradlew clients:test --tests RequestResponseTest
  33. Running a particular test method within a unit/integration test
  34. ./gradlew core:test --tests kafka.api.ProducerFailureHandlingTest.testCannotSendToInternalTopic
  35. ./gradlew clients:test --tests org.apache.kafka.clients.MetadataTest.testMetadataUpdateWaitTime
  36. Running a particular unit/integration test with log4j output
  37. Change the log4j setting in either
  38. clients/src/test/resources/log4j.properties or core/src/test/resources/log4j.properties
  39. ./gradlew clients:test --tests RequestResponseTest
  40. Generating test coverage reports
  41. ./gradlew reportCoverage
  42. Generate coverage for a single module, i.e.:
  43. ./gradlew clients:reportCoverage
  44. Building a binary release gzipped tar ball
  45. ./gradlew clean releaseTarGz
  46. The above command will fail if you haven't set up the signing key. To bypass signing the artifact, you can run:
  47. ./gradlew clean releaseTarGz -x signArchives
  48. The release file can be found inside ./core/build/distributions/.
  49. Cleaning the build
  50. ./gradlew clean
  51. Running a task with a particular version of Scala (either 2.11.x or 2.12.x)
  52. ./gradlew -PscalaVersion=2.12 jar
  53. ./gradlew -PscalaVersion=2.12 test
  54. ./gradlew -PscalaVersion=2.12 releaseTarGz
  55. Running a task with all scala versions:Append All to the task name:
  56. ./gradlew testAll
  57. ./gradlew jarAll
  58. ./gradlew releaseTarGzAll
  59. Running a task for a specific project
  60. This is for core, examples and clients
  61. ./gradlew core:jar
  62. ./gradlew core:test
  63. Listing all gradle tasks
  64. ./gradlew tasks
  65. Building IDE project
  66. Note that this is not strictly necessary (IntelliJ IDEA has good built-in support for Gradle projects, for example).
  67. ./gradlew eclipse
  68. ./gradlew idea
  69. The eclipse task has been configured to use ${project_dir}/build_eclipseas Eclipse's build directory. Eclipse's default build directory (${project_dir}/bin) clashes with Kafka's scripts directory and we don't use Gradle's build directory to avoid known issues with this configuration.
  70. Publishing the jar for all version of Scala and for all projects to maven
  71. ./gradlew uploadArchivesAll
  72. Publishing the streams quickstart archetype artifact to maven
  73. For the Streams archetype project, one cannot use gradle to upload to maven; instead the mvn deploy command needs to be called at the quickstart folder:
  74. cd streams/quickstart
  75. mvn deploy
  76. Please note for this to work you should create/update user maven settings (typically, ${USER_HOME}/.m2/settings.xml) to assign the following variables
  77. <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  78. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  79. xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
  80. https://maven.apache.org/xsd/settings-1.0.0.xsd">
  81. ...
  82. <servers>
  83. ...
  84. <server>
  85. <id>apache.snapshots.https</id>
  86. <username>${maven_username}</username>
  87. <password>${maven_password}</password>
  88. </server>
  89. <server>
  90. <id>apache.releases.https</id>
  91. <username>${maven_username}</username>
  92. <password>${maven_password}</password>
  93. </server>
  94. ...
  95. </servers>
  96. ...
  97. Installing the jars to the local Maven repository
  98. ./gradlew installAll
  99. Building the test jar
  100. ./gradlew testJar
  101. Determining how transitive dependencies are added
  102. ./gradlew core:dependencies --configuration runtime
  103. Determining if any dependencies could be updated
  104. ./gradlew dependencyUpdates
  105. Running code quality checks
  106. There are two code quality analysis tools that we regularly run, spotbugs and checkstyle.
  107. Checkstyle
  108. Checkstyle enforces a consistent coding style in Kafka. You can run checkstyle using:
  109. ./gradlew checkstyleMain checkstyleTest
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/木道寻08/article/detail/754103
推荐阅读
相关标签
  

闽ICP备14008679号