This document describes how to compile and package the TreeBASE artifacts.
Java 17 is required for building TreeBASE. Verify your installation:
$ java -version
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment (build 17.0.9+9-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 17.0.9+9-Ubuntu-120.04, mixed mode, sharing)Linux (Ubuntu 20.04 LTS or later):
sudo apt-get update
sudo apt-get install openjdk-17-jdkWindows and macOS: Download from Adoptium Temurin or Oracle JDK
Ensure Maven is installed:
$ mvn -V
Apache Maven 3.8.7
Maven home: /usr/share/maven
Java version: 17.0.9, vendor: Ubuntu
Java home: /usr/lib/jvm/java-17-openjdk-amd64Note: If you get a message about JAVA_HOME not being set, reinstall the full JDK (not just JRE):
sudo apt install openjdk-17-jdkOn Windows you might need to create this environment variable JAVA_HOME and set it to the installation location of Java.
If Maven is not installed:
sudo apt install mavenor on Windows
goto the download section mavenapache.org
download the Binary zip archive
extract to a folder on your machine, say 'c:\Program Files (X86)\apache-maven-3.9.x'
add 'c:\Program Files (X86)\apache-maven-3.9.x\bin' to your path variables (note the addition of bin!)
start terminal and type mvn
$ git --version
git version 2.7.4Install if needed:
sudo apt install gitgit clone https://github.com/TreeBASE/treebase.git
cd treebaseCompile all modules using the compiler:compile Maven goal:
mvn compiler:compileSuccessful build output:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Treebase ........................................... SUCCESS [ 0.396 s]
[INFO] treebase-core ...................................... SUCCESS [ 3.234 s]
[INFO] treebase-web ....................................... SUCCESS [ 11.620 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Before packaging, copy and configure the database connection files:
-
Core JDBC configuration:
cp treebase-core/src/main/resources/jdbc.properties.example \ treebase-core/src/main/resources/jdbc.properties
Edit
jdbc.propertieswith your database credentials. -
Web application context:
cp treebase-web/src/main/webapp/META-INF/context.xml.example \ treebase-web/src/main/webapp/META-INF/context.xml
Edit
context.xmlwith your database credentials and Mesquite folder location.
Note: Current configuration values are stored in the private repository TreeBASE/treebase-config.
Create the deployable WAR file:
mvn package -Dmaven.test.skip=trueSuccessful packaging output:
[INFO] Packaging webapp
[INFO] Assembling webapp [treebase-web] in [/path/to/treebase/treebase-web/target/treebase-web]
[INFO] Building war: /path/to/treebase/treebase-web/target/treebase-web.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
The build produces:
Located at: treebase-web/target/treebase-web.war
This WAR contains:
- Compiled classes from
treebase-web - Compiled classes from
treebase-core(bundled as JAR inWEB-INF/lib/) - All dependency JARs
- Configuration files (context.xml, jdbc.properties)
- Web assets (HTML, JSP, CSS, JavaScript)
The build operates on these subprojects:
- treebase-core - ORM API for PostgreSQL database access via Hibernate
- treebase-web - MVC web application with JSP/HTML GUI
- oai-pmh_data_provider - OAI-PMH interface functionality
After building, see DEPLOYING.md for deployment instructions.