Development Installation

On this section we cover the complete procedure to setup a development environment for the SWIM backend. The current development version of the SWIM backend runs on a CentOS 7 virtual machine.


  • CentOS 7 64bit (native or virtualized)
  • Virtual Box 5.1.26 (if using VM)
  • VBoxGuestAdditions 5.0.16 (optional)
  • Java JDK 1.8 or latest
  • GAMS 24.7.4 - March 16, 2016 - Linux 64 bit
  • Apache Maven 3.5 or latest
  • Mongo DB

Environment Setup

Virtual Machine with VirtualBox

  1. Download and install Virtual Box [1].
  2. Download and Install a clean CentOS or virtual box image [2].
  3. Start CentOS 7.
  4. Update CentOS 7 to the latest release with the command line.
    # yum clean all
    # yum update
    # reboot
  5. To use full screen resolution capacity VBoxGuestAdditions would need to be installed.
    Mount the iso file to your virtual machine drive and follow the instructions presented here.
    If guest additions is successfully installed, you will be able to use full screen resolution for the CentOS virtual machine.

Java Dependencies

  1. Make sure that the current Java JDK version installed is 1.8 or higher.
  2. You can use the command line to check current version:
    # java -version
  3. You can download the latest version of the Java JDK here.
  4. Install Apache Maven
  5. Check if Maven was properly installed using the following command:
    # mvn --version


  1. MongoDB is used as the default database manager to store model executions.
    Download and install the community edition of MongoDB
  2. Import a clean instance of the mongo watermodels database into mongoDB (Available Soon).

GAMS Installation

  1. Download GAMS version 24.7.4 from here
  2. Follow the GAMS documentation for installation instructions here

Local Maven Repository for GAMS API

  1. In order to use the GAMS API as a Maven dependency, a local custom repository will need to be created.
    Using the command line type the following command, making sure the GAMS installation paths are correct:
    # mvn install:install-file -Dfile=/opt/gams/gams24.7_linux_x64_64_sfx/apifiles/Java/api/GAMSJavaAPI.jar -DgroupId=org.gams.api -DartifactId=gams-api -Dversion=1.0 -Dpackaging=jar
  2. Copy the GAMS API dependency files (/opt/gams/gams24.7_linux_x64_64_sfx/apifiles/Java/api) to the same path as where the maven repository was created (.m2 folder on the current user directory).

Install and Run WMD service.

Note: Public repository will be available after first formal release.

  1. Download or clone the public repository of the water modeling backend.
  2. The source project can be located on the following directory:
  3. Modify the settings.yml according to your installation paths and desired ports.
  4. Open the selected system ports if the service will be available from outside the host.

Running as a web service
1. Run a Maven install command on the project.
2. Execute the compiled jar with the following command from the orchestrator directory:
# java -jar target/wmd-0.9.jar server settings.yml
3. If execution is successful the webservice will be available at localhost:port
4. Go the Tutorials>Water Modeling Webservice for documentation on how to test the webservice.

Running standalone from eclipse
1. Install the latest version of eclipse [6].
2. Import the Maven project into eclipse
File > Import ... > Maven > Existing Maven Projects
3. Select the project folder Java/orchestrator on the repository.
4. Execute a maven install by right clicking on the project and navigating to:
Run as > Maven install
5. Copy the GAMS API Java library files into the generated target directory of the project.
6. Modify the file inside the package according to your environment paths.
Line 49: model scenario input json file.
Lines 53-57: MongoDB connection parameters.
7. Modify the file inside the package according to your environment paths.
Line 164: GAMS work path and GAMS installation path.
Line 200: GAMS model file .gms

Water Distributor Lite

The Water Distributor Lite is a simplified Java application that reads a model scenario specification and executes a corresponding gams model without database and webservice dependency code. The project is available under Java/WMD-Lite.

Note: The current prototype version will be updated before the formal release of the full WMD application.


[1] Virtual Box -
[2] -
[3] VBoxGuestAdditions -
[4] GAMS -
[5] MongoDB -
[6] Eclipse -

Contact Information

Luis Garnica Chavira
Research Associate
University of Texas at El Paso