我要评分
获取效率
正确性
完整性
易理解

Compiling the Source Code

  1. Download the Kafka 0.10.1.1 source package.
    1
    wget https://archive.apache.org/dist/kafka/0.10.1.1/kafka-0.10.1.1-src.tgz --no-check-certificate
    
  2. Decompress the source package.
    1
    tar -zxvf kafka-0.10.1.1-src.tgz
    
  3. Go to the directory where the source code is located.
    1
    cd kafka-0.10.1.1-src
    
  4. Modify the build.gradle file.
    1. Open the file.
      1
      vi build.gradle
      
    2. Press i to enter the insert mode and add the following content to the repositories block under the allprojects section:
       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
        repositories {
          maven {
            url "https://mirrors.huaweicloud.com/kunpeng/maven"
          }
          maven {
            url "https://mirrors.huaweicloud.com/repository/maven"
          }
          maven {
            url "https://plugins.gradle.org/m2/"
          }
          mavenCentral()
          }
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Perform compilation.
    1
    gradle -g /$UserHome/gradleRepository releaseTarGz -info
    

    The compiled package is stored in the following directory:

    If connection timeout 443 error occurs during compilation, run the compile command again.

  6. Use the Kunpeng Porting Advisor to scan the .tar package generated after the compilation and ensure that the .tar package does not contain the x86 .so or .jar packages.
    • The compiled kafka_2.10-0.10.1.1.tgz must be scanned by using the Kunpeng Porting Advisor to ensure that no x86 .so or .jar packages are contained. If the compiled package contains x86 .so or .jar packages, the component functions may be affected.
    • For details about how to use the Kunpeng Porting Advisor, see Kunpeng Porting Advisor Best Practices.