Skip to main content

Installing the Backend Microservice

Step-by-step guide to building, packaging, and deploying the backend microservice component using Maven, JDK, and Tomcat.

Updated over 8 months ago

1. Introduction

This guide provides step-by-step instructions for installing and deploying the backend microservice component of Virifi's Solution Proposal for the Central Bank of Jordan (CBJ) Digital Signature Challenge. The backend is responsible for handling signing operations, validation, and PKI interactions.


2. Prerequisites

Ensure the following components are installed on the deployment system:


3. Build Instructions

Navigate to your project directory and perform the following steps:

3.1 Compile the Project

Clean old compiled files and compile the project:

mvn clean compile

3.2 Package the Project

Compile and create the JAR or WAR file inside the target/ directory:

mvn clean package

3.3 Install Locally

Compile, package, and install the output into your local Maven repository:

mvn clean install

3.4 Skipping Tests (Optional)

If you wish to skip tests during the build:

mvn clean install -DskipTests

3.5 Using Maven Wrapper (Optional)

If the project includes a Maven Wrapper (mvnw file), use:

./mvnw clean compile

3.6 Using an IDE

In IntelliJ IDEA or Eclipse, right-click the project, select Maven, and choose compile, package, or install.


4. Deploying on Apache Tomcat

Once the project is successfully built:

  1. Navigate to:

%PATH%\cbj-java-dss-integration\apache-tomcat-10.1.40\bin
  1. Run the startup script:

  • For Windows:

startup.bat
  • For Linux/MacOS:

./startup.sh

The Java server will start running on the default port:

http://localhost:8080

5. Stopping the Server

To gracefully stop the server:

  • For Windows:

shutdown.bat
  • For Linux/MacOS:

./shutdown.sh

6. Notes

  • Ensure environment variables like JAVA_HOME and MAVEN_HOME are set properly.

  • Ports can be customized by editing the server.xml file inside the Tomcat conf/ directory.

  • Validate Maven and Java installations using mvn -v and java -version before beginning the build.

Did this answer your question?