Compiling and Installing de.flapdoodle.embed.mongo
Obtaining the de.flapdoodle.embed.mongo Source Code
- Go to the /usr/local directory.
1cd /usr/local
- Download the source code.
1wget https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo/archive/de.flapdoodle.embed.mongo-2.2.0.zip --no-check-certificate
- Decompress the de.flapdoodle.embed.mongo source code package.
1unzip de.flapdoodle.embed.mongo-2.2.0.zip - Go to the de.flapdoodle.embed.mongo-de.flapdoodle.embed.mongo-2.2.0 directory generated after the de.flapdoodle.embed.mongo source code package is decompressed.
1cd de.flapdoodle.embed.mongo-de.flapdoodle.embed.mongo-2.2.0
Compiling de.flapdoodle.embed.mongo
- Modify the Paths.java file.
- Open the Paths.java file.
1vim ./src/main/java/de/flapdoodle/embed/mongo/Paths.java - Press i to enter the insert mode and add the following content to line 176:
String osArch = System.getProperty("os.arch"); if(osArch.equals("aarch64")){ sbitSize = "arm64-ubuntu1604"; } else
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the Paths.java file.
- Modify the Version.java file.
The version from the community is 4.0.12, which is the same version used here. You can perform the modification based on the actual version used.
- Open the file.
1vim ./src/main/java/de/flapdoodle/embed/mongo/distribution/Version.java - Press i to enter the insert mode and add the following content to line 220:
V4_0_12("4.0.12", Feature.SYNC_DELAY, Feature.STORAGE_ENGINE, Feature.ONLY_64BIT, Feature.NO_CHUNKSIZE_ARG, Feature.MONGOS_CONFIGDB_SET_STYLE, Feature.NO_HTTP_INTERFACE_ARG, Feature.ONLY_WITH_SSL, Feature.ONLY_WINDOWS_2008_SERVER, Feature.NO_SOLARIS_SUPPORT, Feature.NO_BIND_IP_TO_LOCALHOST),
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Perform the compilation and installation.
1mvn clean install -DskipTests=true
If the de.flapdoodle.embed.mongo-2.2.0.jar package is generated in the target directory, the compilation is successful.
1ll target