Smarti is a Java-Application based on the Spring Framework. The application uses MongoDB as database and Apache Solr as search engine. Installation packages are provided for Debian- and RedHat-based systems. Alternatively the application can be started by directly launching the executable jar:
$ java -jar smarti-${smarti-version}-exec.jar
This section explains how to checkout and build the Smarti application from its sources. By following these steps you will learn how to build, run and debug Smarti. Transfer these instructions on your local machine in order to start setting up your Software Development Environment (SDE).
In order to build & run Smarti the System requirements have to be fulfilled.
How to achieve that heavily depends on your target environment.
When creating this documentation all commands have been executed and tested with Ubuntu 16.04. LTS server running on Amazon EC2 instance (t2.large).
Therefore and to keep it simple we decided to use Debian’s package manager apt-get
for documentation purpose.
Note
|
If you have any trouble please have a look at Troubleshooting, maybe you’re not alone. |
Warning
|
Be careful using copy & paste .The aim of this manual is to explain and not to provide scripts. |
-
Install Java
$ sudo apt-get install openjdk-8-jdk
-
Install MongoDB (optional)
$ sudo apt-get install mongodb-server
-
Install build components
$ sudo apt-get install git maven ruby ruby-sass ruby-compass
-
Create a source directory
${smarti-source}
$ mkdir ${smarti-source}
-
Checkout Smarti source code from GitHub
$ git clone https://github.com/redlink-gmbh/smarti.git ${smarti-source}
-
Create a working directory
$ mkdir ${smarti-work-dir} && cd ${smarti-work-dir}
NoteWorking directory - If you launch smarti the first time the application.properties
file is created inside the directory wherejava -jar
is executed. When ever this documentation refers the${smarti-work-dir}
, the directory where theapplication.properties
is located, is being meant. Since Smarti is a Spring boot application you can externalize the configuration as explained in the Spring docs. -
Copy the executable jar into
${smarti-work-dir}
$ mv ${smarti-source}/dist/target/smarti-${smarti-version}-exec.jar .
-
Launch smarti
$ java -jar smarti-${smarti-version}-exec.jar
NoteStanford NLP - If you want to use Stanford NLP analysis, ensure that the required libraries are included in the class path. For more information and how to achieve this read section Enable Stanford NLP. NoteCommon challenges - If this the first time you’re running Smarti, you may have been stepped into a pitfall and it does not work. We have picked up some common challenges that might be helpful. See sections Troubleshooting in any case of problems.
-
Launch smarti in debug mode
To launch Smarti in debug mode create a shell script appending preferred options to the
java
-command like:start-smarti.sh#!/bin/bash java -Xmx4g -jar \ -Xdebug -Xrunjdwp:transport=dt_socket,address=${smarti-debug-port},server=y,suspend=n\ -Dspring.profiles.active=local\ application/target/smarti-${smarti-version}-exec.jar\ --solrlib.home=${solr-home}
-
Configure your IDE
Create a debug configuration for the
Remote Java Application
and set the specified${smarti-debug-port}
.
For a release, a release branch (based on develop) is created which represents the release candidate. If the candidate fulfills the requirements, the issues of the release are documented in the changelogs. Then the version number is set to the release number, the branch is merged into master and the master is tagged with the release number. Additionally, the version number of the develop branch is set to the new snapshot version.
Note
|
Now you are ready to start developing the next amazing feature for Smarti. |
Caution
|
Read Additional Components section. |