Building from scratch

These instructions are for advanced engineers who want to run their own instance of FeatureHub.

If you don’t need to customise or enhance FeatureHub, we recommend using the prebuilt Docker images for running FeatureHub.

Build Instructions

This project requires you to have Java 11 as your primary Java and Maven 3.5 or later installed.

Java 11 on Mac OS X

This downloads as a gziped tar file, extract the folder and move it to /Library/Java/JavaVirtualMachines but ensure you tack a .jdk on the end, so jdk-11.0.2+9 becomes /Library/Java/JavaVirtualMachines/jdk-11.0.2+9.jdk. Then set the environment variable JAVA_HOME to that folder + `/Contents/Home'.

We recommend using brew on Mac OS X to install Java. You can use any version 11+.

If you have downloaded it from AdoptOpenJDK (or used brew), then use this:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home

If you have downloaded it from Oracle, use the following (or similar based on the version you have)

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.2+9.jdk/Contents/Home

This will cause the installed 'java' to swap to that version. Type java -version to confirm it has changed.

Building from the command line

This application stack uses Java 11+.

To install FeatureHub run:

cd backend && mvn -f pom-first.xml clean install && cd .. && mvn -T4C clean install

Build should include the Docker ready tar file (see below).

If you get an error like --release not known, you are using Java 8.

Just the APIs

If you just want to install the apis and ensure they are consistent, use:

mvn -f pom-api.xml clean install

Front-end

If you wish to do individual builds, which we recommend if you are overriding base images and so forth, cd into those folders. First you will need to make sure the front end builds - it normally builds and installs as part of the whole build process. Go into the admin-frontend folder and type:

mvn -Ddocker-cloud-build=true clean install

This is a docker build using a Flutter image of the front-end.

Then jump into your chosen folder and your command is:

mvn -Ddocker-cloud-build=true -Dapp.baseimage=docker://featurehub/base_mr:1.7 -Dapp.port=8085 -Dbuild.version=0.0.1 clean package

Where the app.baseimage, app.port and build.version are the versions you specify. The docker:// prefix just means it will pull it from Docker. It is using jib from Google, so you may wish to further play around with those settings.

Running NATS

docker run -d --name nats-main -p 4222:4222 -p 6222:6222 -p 8222:8222 nats:2.1.2-scratch

if you were running it and the container has shut down for some reason (machine reset for example):

docker restart nats-main

Alternatively, you can simply download it for your O/S and run it. It takes up less memory.