Compiling the Source Code
- Download the Kafka 0.10.1.1 source package.
1wget https://archive.apache.org/dist/kafka/0.10.1.1/kafka-0.10.1.1-src.tgz --no-check-certificate
- Decompress the source package.
1tar -zxvf kafka-0.10.1.1-src.tgz
- Go to the directory where the source code is located.
1cd kafka-0.10.1.1-src
- Modify the build.gradle file.
- Open the file.
1vi build.gradle - 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() }
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Perform compilation.
1gradle -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.
- 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.
Parent topic: Porting Guide (CentOS & openEuler)