Set up the development environment
1. Git
Install and configure Git (ssh keys, commits and tags signing, user and email).
- Set your username.
- Set your email address.
- Generate an SSH key.
- Add the public key to your GitHub account for authentication and signing.
- Configure Git to sign commits with your SSH key.
2. Repositories
Before you start, you need to properly configure your working repository to have origin and upstream remotes.
-
Clone the
wazuh-indexer
forkgit clone git@github.com:wazuh-indexer.git git remote add upstream git@github.com:opensearch-project/opensearch.git
-
Clone the
wazuh-indexer-reporting
forkgit clone git@github.com:wazuh/wazuh-indexer-reporting.git git remote add upstream git@github.com:opensearch-project/reporting.git
-
Clone the
wazuh-indexer-plugins
repositorygit clone git@github.com:wazuh/wazuh-indexer-plugins.git
3. IntelliJ IDEA
Prepare your IDE:
- Install IDEA Community Edition as per the official documentation.
- Set a global SDK to Eclipse Temurin following this guide.
You can find the JDK version to use under the
wazuh-indexer/gradle/libs.versions.toml
file. IntelliJ IDEA includes some JDKs by default. If you need to change it, or if you want to use a different distribution, follow the instructions on the next section.
4. JDK (Optional)
We use the Eclipse Temurin JDK. To use a different JDK installed on your machine, use sudo update-alternatives --config java
to select the JDK of your preference.
Set the JAVA_HOME and PATH environment variables by adding these lines to your Shell RC file (.bashrc
, .zsrhrc
, …):
export JAVA_HOME=/usr/lib/jvm/temurin-21-jdk-amd64
export PATH=$PATH:/usr/lib/jvm/temurin-21-jdk-amd64/bin
After that, restart your shell or run source ~/.zshrc
(or similar) to apply the changes. Finally, check Java is installed correctly by running java --version
.