Retail:Hardware Manager compilaton
Contents |
Introduction
The Hardware manager is the Openbravo application which integrates the Web POS front end with the peripherals. It is a native java application that requires to be compiled, packaged and deployed in each POS terminal that requires integration with peripherals or other external systems invoked from the Web POS terminal. This document describes how to compile the Hardware manager, the required extension plugins and create the distribution package.
Prerequisites
The Openbravo Hardware manager, including its extension plugins, is a Java native application. To build it from sources it is required Java JDK 11 or greater. The version used must be a version compatible with the Java runtime installed in the POS terminals it will be deployed. Java JDK can be obtained from https://openjdk.java.net/ .
To execute the build scrips of the Hardware manager and the extension plugins it is required Apache ant 1.10.6 or greater. Apache ant can be obtained from https://ant.apache.org/ .
Hardware manager
There are two modules needed to build the Hardware manager:
- org.openbravo.retail.poshwmanager.sources. This module contains the sources of the Hardware manager and build scripts.
- org.openbravo.retail.poshwmanager. This module contains the Hardware manager distribution created using the build script of the first module
Both modules require to be installed in a working instance of Openbravo.
Build script
The build script is located in the folder project of the module org.openbravo.retail.poshwmanager.sources. This build script contains two main tasks:
- dist: This task compiles the Hardware manager and creates all the distribution files. The distribution files are created in the folder module of the org.openbravo.retail.poshwmanager.sources module. It also creates a file named bin/rev.id with the GIT SCM version of the org.openbravo.retail.poshwmanager.sources module current parent.
- deploy: This creates the distribution file and deploys it to the module org.openbravo.retail.poshwmanager. To work properly, the two modules must be located as direct sons of the folder modules in the Openbravo sources folder.
Example
To create and deploy the distribution files, be sure you have installed the correct java version you are targetting executing
java -version
Then go to the folder project of the module org.openbravo.retail.poshwmanager.sources and execute:
ant deploy
After receiving the BUILD SUCCESSFUL message, go to the module org.openbravo.retail.poshwmanager and verify there is a new distribution of the Hardware manager created in the bin folder.
Extension plugins
Each extension module has its own sources organizaction. This section describes the standard flow for compiling and deploying extension plugins created by Openbravo.
The folder containing the plugin sources must be located in the same folder the root folder of the Openbravo sources. This Openbravo sources instance must have a working compilation of the Hardware manager binaries located in openbravo/modules/org.openbravo.retail.poshwmanager to find the dependencies needed to compile properly the plugin.
Build script
The extension plugin build script contains one main task:
- plugin: This task compiles the the plugin and copy all the distribution files in the folder plugin of the sources folder.
Example
Be sure you have installed the correct java version you are targetting executing.
java -version
Then go to the folder containing the extension plugin. This folder must have a file build.xml containing the build scripts. And execute the following command:
ant plugin
After receiving the BUILD SUCCESSFUL message, go to the folder plugin and verify there is a new distribution file of the extension module with all the required dependencies.
Installation
To install the plugin it is needed to copy all the distribution files created in the plugin folder inside the bin/libext folder of the module org.openbravo.retail.poshwmanager
Deployment and configuration
After the Hardware manager and all the needed extension plugins have been compiled and the plugins copied to the bin/libext, it can be packaged and installed to all the Web POS terminals using the prefered deployment option.
The most simple deployment way is to copy all the files in the folder bin of the org.openbravo.retail.poshwmanager module, package in a single compressed file, distribute to all Web POS terminals and uncompress in a dedicated folder.
To configure all the included supported functionality follow the Hardware and Peripherals Installation guide. Each extension plugins will have its own configuration details that usually go in the openbravohw.properties file with the rest of the Hardware manager configuration options.
Finally it is usually recommended to execute the Hardware manager in the start of the Web POS terminal and keep it running during all the session.