Fork this repository on GitHub, and clone locally with git clone
.
OpenSearch builds using Java 11 at a minimum, using the Adoptium distribution. This means you must have a JDK 11 installed with the environment variable JAVA_HOME
referencing the path to Java home for your JDK 11 installation, e.g. JAVA_HOME=/usr/lib/jvm/jdk-11
. This is configured in buildSrc/build.gradle and distribution/tools/java-version-checker/build.gradle.
allprojects {
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Download Java 11 from here.
To run the full suite of tests, download and install JDK 14 and set JAVA11_HOME
, and JAVA14_HOME
.
- Clone the repository (see Forking and Cloning)
- Make sure
JAVA_HOME
is pointing to a Java 11 JDK (see Install Prerequisites) - Launch Intellij IDEA, Choose Import Project and select the settings.gradle file in the root of this package.
This package uses the Gradle build system. Gradle comes with excellent documentation that should be your first stop when trying to figure out how to operate or modify the build. We also use the OpenSearch build tools for Gradle. These tools are idiosyncratic and don't always follow the conventions and instructions for building regular Java code using Gradle. Not everything in this package will work the way it's described in the Gradle documentation. If you encounter such a situation, the OpenSearch build tools source code is your best bet for figuring out what's going on.
./gradlew build
builds and tests all subprojects../gradlew run
launches a single node cluster with the security analytics plugin installed.
When launching a cluster using one of the above commands, logs are placed in build/testclusters/integTest-0/logs/
. Though the logs are teed to the console, in practice it's best to check the actual log file.
Currently, the only IDE we support is IntelliJ IDEA. It's free, it's open source, it works. The gradle tasks above can also be launched from IntelliJ's Gradle toolbar and the extra parameters can be passed in via the Launch Configurations VM arguments.