= OpenSpecimen HowTo Build from Source Code Tags: [[OpenSpecimen Summary]] [[HowTo]] This guide is based on my experience and the [[https://openspecimen.atlassian.net/wiki/pages/viewpage.action?pageId=1115955|Official Guide on How to Build Open Specimen]] This is the procedure for building the `war` file. The [[Gradle]] build script can also be used to deploy OpenSpecimen to a local instance, but that is not covered here. == Prerequisites - Java JDK v1.8 - Gradle 2.0 - git - node.js 10+ - npm - bower - `npm install -g bower` - grunt - `npm install -g grunt-cli` - `$JAVA_HOME` set to the JDK directory === Gotchas 1. The first time I build OpenSpecimen using this method I had to upgrade node and npm before installing bower and grunt. 2. Gradle could not find node because on Ubuntu it is called nodejs so I had to create a symbolic link `sudo ln -s nodejs node` in the directory `/usr/local/bin/`. == Procedure See: [[https://openspecimen.atlassian.net/wiki/pages/viewpage.action?pageId=1115955]] 1. Download the source code from the **releases** tab of the [[https://github.com/krishagni/openspecimen.git|Open Specimen Github Repository]] - **Make sure to get the correct branch for the required version** 2. Edit the `build.properties` file with the correct values. Here are the values for the university LAMP servers. The other values not in this list can be deleted: {{{ #!ini app_home = /local/openspecimen_{version_number}/app app_data_dir = /local/openspecimen_{version_number}/app/osdata datasource_jndi = java:/comp/env/jdbc/openspecimen deployment_type = upgrade database_type = mysql show_sql = false plugin_dir = /local/openspecimen_{version_number}/app/plugins }}} 3. `cd` into the `www` directory 4. Run the command `npm install` 5. Run the command `bower install` 6. `cd ..` 7. Run the command `gradle build` == Deploying to [[Tomcat]] 1. Copy the `war` file to the [[Tomcat]] `webapps` directory. 2. Amend the file in the Tomcat directory `conf/context.xml` to set up the resource: {{{ #!xml }}} [[BackLinks]]