Skip to content

OMS Build Notes

Janvi Talreja edited this page Apr 18, 2022 · 3 revisions

Prerequisites

  1. The Java version should be java 8. Check java version of your machine.

    $ java -version

  2. The Mysql version should be 5.7.x, Check mysql version of your machine.

    $ mysql -version

  3. You should know how to navigate to file directories on your machine via the terminal window.

Clone the repository (code)

  1. Open a Terminal window.

  2. Go to ~/sandbox (or create the directory).

  3. Clone moqui-framework.

    $ git clone -b master https://github.com/hotwax/moqui-framework.git

  4. Go to moqui-framework directory, add the runtime component.

    $ cd moqui-framework

    $ git clone -b master https://github.com/hotwax/moqui-runtime.git runtime

  5. Go to moqui-framework/runtime/component, and clone the below required components.

    $ git clone -b master https://github.com/hotwax/mantle.git

    $ git clone -b master https://github.com/hotwax/oms.git

Database Setup

Need to add gradle dependencies in the build.gradle file for database connectivity, you can add this in the custom component’s build.gradle.

Note: For MySQL, the JDBC dependency is already added in the oms component’s build.gradle file as below:

runtime 'mysql:mysql-connector-java:5.1.47'

Create Database

Create a database using the following command:

CREATE DATABASE moqui CHARACTER SET utf8

Update the Mysql configuration

For Development:

Update the runtime/conf/MoquiDevConf.xml and add the mysql database name, user and password detail

<default-property name="entity_ds_host" value="127.0.0.1"/>
<default-property name="entity_ds_database" value="moqui"/>
<default-property name="entity_ds_user" value="moqui"/>
<default-property name="entity_ds_password" value="moqui"/> 

For Production:

  • Update the runtime/conf/MoquiProductionConf.xml and add the mysql database name, user and password detail.
  • For production its recommended to use 3 databases
    • transactional
    • analytical
    • configuration
<default-property name="entity_ds_database" value="moqui"/>
<default-property name="entity_ds_user" value="moqui"/>
<default-property name="entity_ds_password" value="moqui"/>

ElasticSearch Setup

  1. Download elasticsearch 7.4.2 or higher version

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.4.2.tar.gz

    Unzip tar

    tar -xzvf elasticsearch-7.4.2.tar.gz .

    OR

    Access the following url on browser

    Linux:

    https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.4.2-linux-x86_64.tar.gz

    Mac:

    https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.4.2-darwin-x86_64.tar.gz

    Unzip tar

    tar -xzvf elasticsearch-7.4.2-linux-x86_64.tar.gz

  2. Go to elasticsearch-7.4.2

    cd elasticsearch-7.4.2

  3. Start ElasticSearch

    ./bin/elasticsearch

  4. Stop ElasticSearch

    ctrl + c

Data Load

It's recommended to use XA Transactions aware databases, mysql supports the xa-transactions for InnoDB storage engine.

Go to moqui framework directory

cd ~/sandbox/moqui-framework

development environment

$ ./gradlew load -Ptypes=seed,seed-initial,install,ext-seed,ext,ext-order-demo,demo,ext-seed-initial

production environment

$ ./gradlew loadProduction -Ptypes=seed,seed-initial,install,ext-seed,ext,ext-prod,ext-seed-initial

Start OMS

After successful data load , run Moqui.

Development:

$ ./gradlew run

Production:

  • Generate war file using following command.

    $ ./gradlew addRuntime

  • You will get the war file at following location.

    ~/sandbox/moqui-framework/moqui-plus-runtime.war

  • Deploy war file in any application container.

Access the applications

  1. Backend Application (Development)

    URL : http://localhost:8080/apps

    Username : john.doe

    Password : moqui

Stop OMS

Stop OMS (Development)

`ctrl + c`

Revisit the Application at a Later Time

  1. Update OMS components.

    1. Navigate to ~/sandbox/moqui-framework and update the code to the current version.
    2. Goto runtime and update the code to the current version.
    3. Goto runtime/component and update all the component to current version.
  2. To start application use command

    1. Clean application . /gradlew clean
    2. Build application
      . /gradlew build
    3. Run application
      ./gradlew run