Build from Source

Clone the POB source code repository to your development or deployment environment, and build the POB software services and applications.

Last Updated: 26 May 2022 • Page Author: Jillur Quddus

Overview

This page details how to clone the POB source code repository into your development or deployment environment, and then how to compile, build and package the respective POB software services and applications ready for deployment.

Build Tools

Please ensure that the following prerequisite build tools are installed in your development or deployment environment:

  • OpenJDK 11 - open source reference implementation of Java 11. Please confirm that OpenJDK 11 (or equivalent) is installed correctly by running the following command via your command line:

$ java -version

openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment (build 11.0.13+8-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.13+8-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)
  • Apache Maven - open source build automation tool for Java. Please confirm that Apache Maven is installed correctly by running the following command via your command line:

$ mvn --version

Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.13, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "5.13.0-28-generic", arch: "amd64", family: "unix"
  • Git - open source distributed version control system. Please confirm that Git is installed correctly by running the following command via your command line:

$ git --version

git version 2.25.1

Source Code Repository

The open-source source code for POB may be found on GitHub in the following public repository: https://github.com/hyperlearningai/pob.

Cloning the Source Code

To clone the POB source code repository into your development or deployment environment, please run the following Git command via your command line (or your preferred Git GUI tool):

# Clone the POB GitHub public repository
$ git clone https://github.com/hyperlearningai/pob.git

# Navigate into the POB project folder
# This location will hereafter be referred to as $POB_BASE
$ cd pob

The directory into which you cloned the POB source code repository will hereafter be referred to as $POB_BASE throughout the remaining documentation.

Maven Profiles

Parent Profiles

The following table describes the Maven profiles defined in $POB_BASE/pom.xml.

Application Profiles

The following table describes the Maven profiles defined in $POB_BASE/pob-apps/pom.xml.

Compile and Build

Configuration

Please ensure that you have entered the correct configuration into the Spring bootstrap and application property files, appropriate to your target deployment environment, prior to running mvn package below.

As described in Application Configuration, you should set all of your sensitive properties in application.yml as externalised variables rather than plaintext. This way, if you need to change these properties, you do not need to rebuild and redeploy POB - rather you just update the relevant values in your secrets management service such as HashiCorp Vault, Azure Key Vault or AWS Secrets Manager. You may also wish to set non-sensitive properties as externalised variables for the same reason or, alternatively, setup a Spring Cloud Config Server and Client to avoid rebuilding and redeploying POB each time a non-sensitive property value is updated.

Package

To compile and build POB services and applications from source, please run the following commands from your command line.

# Navigate to $POB_BASE
$ cd $POB_BASE

# Clean the project working directory
$ mvn clean

# Compile, build and package POB
# By default this will build all services and applications
$ mvn package

# If you wish to build POB's core services only, 
# then disable the "apps" Maven profile as follows.
$ mvn package -P \!apps

# If you wish to build POB's core services but only the
# apps intended for deployment to a self-managed environment
# or to Spring Cloud, then enable the "apps-spring" Maven 
# profile as follows.
$ mvn package -P apps-spring

# If you wish to build POB's core services but only the
# apps intended for deployment to AWS, then enable the 
# "apps-aws" Maven profile as follows.
$ mvn package -P apps-aws

# If you wish to build POB's core services but only the
# apps intended for deployment to Azure, then enable the 
# "apps-azure" Maven profile as follows.
$ mvn package -P apps-azure

If you are running mvn package for the first time, it will take approximately 3 - 5 minutes to complete the build (dependent on the speed of your internet connection) as Maven will download all the required Java dependencies for the first time. Subsequent executions of mvn package should take between 1 - 2 minutes to complete.

Deployment

Assuming that mvn package completes successfully, you are now ready to deploy POB. Please follow the links below for deployment instructions specific to your target deployment environment:

  • Self Managed - deploy POB to a self-managed on-premise, public/private cloud or hybrid environment, integrated with entirely open-source self-managed software services including HashiCorp Vault and HSQLDB.

  • Microsoft Azure - deploy POB to the Microsoft Azure cloud computing platform, integrated with Azure managed services including Azure Key Vault and Azure Functions.

  • Amazon Web Services - deploy POB to the Amazon Web Services (AWS) cloud computing platform, integrated with AWS managed services including AWS Secrets Manager, Amazon S3, Amazon RDS and AWS Lambda.

Last updated