Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling and Installing de.flapdoodle.embed.mongo

  • If a proxy is required by the host to access the Internet, configure Cntlm. For details, see Configuring Cntlm.
  • If the message "validity check failed" is displayed during file download, perform configuration by referring to Importing the Certificate.

Obtaining the de.flapdoodle.embed.mongo Source Code

  1. Go to the /usr/local directory.
    1
    cd /usr/local
    
  2. Download the source code.
    1
    wget https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo/archive/de.flapdoodle.embed.mongo-2.2.0.zip --no-check-certificate
    
  3. Decompress the de.flapdoodle.embed.mongo source code package.
    1
    unzip de.flapdoodle.embed.mongo-2.2.0.zip
    
  4. 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.
    1
    cd de.flapdoodle.embed.mongo-de.flapdoodle.embed.mongo-2.2.0
    

Compiling de.flapdoodle.embed.mongo

  1. Modify the Paths.java file.
    1. Open the Paths.java file.
      1
      vim ./src/main/java/de/flapdoodle/embed/mongo/Paths.java
      
    2. 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

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  2. 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.

    1. Open the file.
      1
      vim ./src/main/java/de/flapdoodle/embed/mongo/distribution/Version.java
      
    2. 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),

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Perform the compilation and installation.
    1
    mvn 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.

    1
    ll target