Develop in Eclipse - bobbyiliev/dbeaver GitHub Wiki
DBeaver is an Eclipse RCP application.
It consists of a set of Eclipse plugins, features, and products.
Opening workspace in Eclipse
You will need to setup Eclipse IDE for RCP and RAP Developers. The current default Eclipse version is 2023-06. As the build may fail on older and newer versions, you will need to install a few additional Eclipse plugins which DBeaver depends on (and which are not included in the standard Eclipse distribution):
-
Open main menu Help -> Install New Software
-
Copy
https://p2.dev.dbeaver.com/eclipse-repo/
into the "Work with" field and press enter -
Check all plugins and finish the installation process:
-
Do the same for
http://eclipse-color-theme.github.io/update
-
Restart Eclipse
-
Check out the DBeaver repository somewhere with the
git clone https://github.com/dbeaver/dbeaver.git
command. -
In Eclipse run Import wizard
-
Choose "General->Existing Maven Projects".
-
Select the DBeaver checkout directory. Check all plugins and features Eclipse will find and finish the wizard.
-
Eclipse will perform the project configuration process. This may take a few minutes.
-
If Eclipse will ask about additional plugin install - just agree:
-
Restart Eclipse. Eclipse will build the project automatically or you can press
Ctrl+B
-
Switch to Hierarchical projects presentations
-
If some modules failed to build (they will be marked with red cross) - update the Maven project
-
If you cannot compile and see errors "Access Restriction" in the Error log then you can turn these errors into warnings. Open context menu on the "Access Restriction" error line->Quick Fix->Configure problem severity.
Running and Debugging in Eclipse
-
Import the DBeaver launch configuration using the Eclipse Import wizard:
-
Click on the Debug icon in the main toolbar->Debug configurations.
-
Choose DBeaver.product and click the Debug button
If the product will not start with the No application id has been found
error, try this workaround:
https://stackoverflow.com/questions/13575695/eclipse-rcp-no-application-id-has-been-found
What you need to do is go to your Run Configurations (Run -> Run Configurations). Select the Plug-ins tab and then hit "Add Required Plug-ins". Apply, then Run, and it should work now.
That is it.
Sources structure:
docs
- some documentations (mostly outdated)features
- feature descriptors. Does not contain any source code. Used to structurize the product plugins/dependencies.bundles
- very base plugins (like utils)plugins
- main sources locationorg.jkiss.dbeaver.model
- model API and base classes. Does not contain any UI dependencies, just a pure data model.org.jkiss.dbeaver.core
- main DBeaver module. Most of the base UI classes are here.org.jkiss.dbeaver.ui.app.standalone
- a relatively small module which configures standalone DBeaver application.org.jkiss.dbeaver.ui.app.eclipse
- the main Eclipse plugin. Adds some extra menus/views to the standard Eclipse IDE.org.jkiss.dbeaver.ext.*
- DBeaver extensions
product
- the final products (standalone and Eclipse plugin) configuration.
Notes:
Everything above covers the Community Edition version.
Include plugins in the debug info.
Sometimes your plugins may depend on other plug-ins that are not included in the DBeaver.product.launch file. You can check it Debug Configurations->Plug-ins tab with the button "Validate Plug-ins". In the dialogue of the problems of the dependences appears, you can use the magic button "Add Required Plug-ins". Sometimes it solves all dependencies problems.
Or you can add the necessary dependencies manually. Small tip: If you added a new plugin and you are confident that it should work, but after the project building you do not see the changes - perhaps the plugin is not marked in the tab Plug-ins.
Troubleshooting
Sometimes you may encounter Conflicting lifecycle mapping metadata
errors.
To solve it, you need to create the file lifecycle-mapping-metadata.xml
in the eclipse-workspace.metadata.plugins\org.eclipse.m2e.core
with following data:
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
<lifecycleMappingFilters>
<lifecycleMappingFilter>
<symbolicName>org.eclipse.m2e.pde.connector</symbolicName>
<versionRange>[2.1.2,)</versionRange>
<packagingTypes>
<packagingType>eclipse-test-plugin</packagingType>
<packagingType>eclipse-plugin</packagingType>
<packagingType>eclipse-feature</packagingType>
</packagingTypes>
</lifecycleMappingFilter>
</lifecycleMappingFilters>
</lifecycleMappingMetadata>