Running standalone

Spring Boot as runtime framework of OpenHub supports running standalone via executable jar/war. This feature is also supported by OpenHub framework.

How to build

OpenHub uses fat war approach - basically all necessary dependencies are packaged together and this war archive can by launched by Spring Boot WarLauncher. To package all dependencies (DB drivers, embedded servlet container and so on) it is necessary to use maven profile esb.executable:

Build command
mvn clean && mvn package -P esb.executable

Result of build can be found in war/target/openhub-exec.war (relative to root of project).

Be careful if additional maven profiles are activated dynamically, for example esb.dev (or esb.prod). Recommended approach is to strictly define which maven profiles should be touch into account.

Running

By default OpenHub uses Tomcat as embedded servlet container. Actually Tomcat 8.x is used, but it is possible to change version of tomcat:

<properties>
  <tomcat.version>8.0.3</tomcat.version>
</properties>

If H2 database is used, it is possible to use persistent type of H2 (embedded mode, not in-memory mode), but H2 database must be initialized correctly. Initialization of H2 is automatic if flyway.enabled=true (default value in application.properties). See more information how to use Flyway.


There are many ways how OpenHub (generally Spring Boot application) can be started:

  • via command line (in root of project where OpenHub is dowloaded or cloned):

    java $JAVA_OPTS -Dserver.port=8080 -Dspring.profiles.active=example-module,h2 -jar war/target/openhub-exec.war
  • via development environment (examples,h2 spring profiles have to be activated)

  • via run-ofh.sh running script

    This script is in root of downloaded (or cloned) project. It is free to change, by default this script expects openhub-exec.war in same folder as running script.
  • or via cloud provider

After OpenHub runs you can verify that everything is ok via http://localhost:8080/http/version (if you use default server address and port binding). Or look at Admin GUI (see login credentials) at address http://localhost:8080/web/admin/console/

By default OpenHub is started on root context and 8080 port, but it can be customized with for example JVM arguments:

  • server.address - Network address to which the server should bind to.
  • server.context-path - Context path of the application.
  • server.port - HTTP server port.
  • spring.profiles.active - which Spring profiles will be activated
java $JAVA_OPTS -Dserver.port=8080 -Dspring.profiles.active=example-module,h2 -jar war/target/openhub-exec.war