Snappy-java-1.1.0.1
Installing sbt
- Download sbt-0.13.15 to a specified directory (for example, /opt/tools/installed) and decompress it.
1 2 3
wget https://github.com/sbt/sbt/releases/download/v0.13.15/sbt-0.13.15.tgz tar -zxf sbt-0.13.15.tgz mv sbt /opt/tools/installed
- Create the .sbt folder in the root directory of the current user and copy the repositories file to the .sbt folder.
The repositories section defines the sequence in which the Maven repositories are used during sbt compilation.
1 2
mkdir ~/.sbt cp repositories ~/.sbt
The content of the repositories file is as follows:
1 2 3 4 5 6
[repositories] local kunpeng-maven: https://mirrors.huaweicloud.com/kunpeng/maven/ huawei-maven: https://mirrors.huaweicloud.com/repository/maven/ sbt-releases-repo: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] sbt-plugins-repo: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
- Configure the SBT_HOME environment variable.
- Open the /etc/profile file.
1vi /etc/profile - Press i to enter the insert mode and add the following content to the profile file:
1 2
export SBT_HOME=/opt/tools/installed/sbt export PATH=${SBT_HOME}/bin:${PATH}
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the /etc/profile file.
- Make the environment variable take effect.
1source /etc/profile
Compiling snappy-java-1.1.0.1
- Download the source package.
1 2
wget https://github.com/xerial/snappy-java/archive/1.1.0.1.zip --no-check-certificate mv 1.1.0.1.zip snappy-java-1.1.0.1.zip
- Decompress the source package.
1unzip snappy-java-1.1.0.1.zip - Go to the directory where the Snappy source package is decompressed.
1cd snappy-java-1.1.0.1
- Modify the Makefile file.
- Open the file.
1vi Makefile - Press i to enter the insert mode. In the Makefile file, modify the download URL of the Snappy package (comment out the original download URL and add the new one).
#curl -o$@ http://snappy.googlecode.com/files/snappy-$(VERSION).tar.gz curl -o$@ https://src.fedoraproject.org/repo/pkgs/snappy/snappy-1.1.0.tar.gz/c8f3ef29b5281e78f4946b2d739cea4f/snappy-$(VERSION).tar.gz
- In the Makefile file, modify the decompression command (comment out the original decompression command and add the new one).
# $(TAR) xvfz $< -C $(TARGET) $(TAR) xvf $< -C $(TARGET)

- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Compile the source code.
1make
The generated JAR package after the compilation is stored in target/snappy-java-1.1.0.1-SNAPSHOT.jar.
- Modify the pom file.
1vi pom.xml
- Perform the compilation again.
1make
The generated JAR package after the compilation is stored in target/snappy-java-1.1.0.1.jar.
Parent topic: Compiling snappy-java