Develop in IDEA
Table of contents
Overview
DBeaver is built on the Eclipse Platform, making the Eclipse IDE a logical choice for its development. However, many developers prefer the IntelliJ IDEA.
In this guide, we aim to demonstrate how to open the DBeaver project in IDEA, write and compile code, and, most importantly, run and debug the application, leveraging the excellent Java debugger available in IDEA.
Instructions
Opening the project and understanding its module structure in IDEA is relatively straightforward. The complexity arises when attempting to run or debug the project, as this process requires an Eclipse runtime workspace, a feature exclusive to the Eclipse IDE that IntelliJ IDEA does not support.
Opening DBeaver in IDEA
- Create a folder where you will clone DBeaver repositories.
Note: all repositories must be located in the same folder. For example, name it
dbeaver-ce
. - Navigate to the created folder using the command:
cd dbeaver-ce
. - Clone the DBeaver repository with:
git clone https://github.com/dbeaver/dbeaver.git
. - Clone the IDEA generator with:
git clone https://github.com/dbeaver/idea-rcp-launch-config-generator.git
. - Clone the common components with:
git clone https://github.com/dbeaver/dbeaver-common.git
.Tip: Optionally, for documentation purposes, clone the WIKI repository with:
git clone https://github.com/dbeaver/dbeaver.wiki.git
(skip this step if you do not need the WIKI). - Open the
dbeaver-common
folder in the console and runmvn clean install
. - Execute the
generate_workspace
script in either the DBeaver or CloudBeaver repository, depending on the workspace you need. Once dependencies are downloaded and IDEA configurations are created, thedbeaver-workspace
folder will appear. The IDEA configuration, by default, will be generated indbeaver-workspace/dbeaver-ce
ordbeaver-workspace/cloudbeaver-ce
, which can be opened in IntelliJ IDEA. - Launch IntelliJ IDEA and open the project in the folder. It should contain all launch configurations.
- If you see a popup about importing Maven projects, press Skip. Otherwise, IDEA might add all existing modules as Maven projects, breaking the project build.
- Before compiling, you need to build the parser grammar files. To do this, then you need to build DBeaver using
Maven. Open the Terminal and execute
mvn clean install
in thedbeaver
folder. - For DBeaver, everything is set up and ready. Press CTRL+F9 and wait. CloudBeaver requires the following additional steps to launch properly:
Additional steps for Cloudbeaver
- To launch CloudBeaver, we first need to execute the
build.sh
orbuild.bat
script incloudbeaver/deploy
. After the script execution
cloudbeaver
folder will appear. Create theopt
folder in the root directory and copy it there.
Troubleshooting
If you encounter problems, do not hesitate to double-check your configuration and try again. If you're still experiencing issues, feel free to ask for help at tickets.