Developing with Eclipse
This page explains how to compile and run the BaseX sources on your system using the Eclipse IDE.
Another article describes how to use BaseX as a query processor in Eclipse.
Prerequisites
BaseX is developed using the Eclipse environment (other IDEs such as IntelliJ IDEA can also be used). The Eclipse IDE includes the EGit plugin (for Git) and the m2e plugin (for Maven). Other plugins we use are:
| Name | Description | Update URL |
|---|---|---|
| eclipse-cs | Enforce Checkstyle coding conventions | https://checkstyle.org/eclipse-cs-update-site |
| SpotBugs | Analyze project at byte code level | https://spotbugs.github.io/eclipse |
| UCDetector | Detect unnecessary code | http://ucdetector.sourceforge.net/update |
Check Out
The sources are hosted in the GitHub repository. Team members can clone it directly; external contributors are invited to create a fork of the project first, and to propose their changes as pull requests.
Import with EGit
- In the Package Explorer, right-click and choose Import…
- Select Git → Projects from Git (with smart import) and click Next
- Choose Clone URI. The local copy will include the full project history
- Enter the repository URI in the Location field. The read-only URI is
https://github.com/BaseXdb/basex.git; if you want to use SSH, make sure you have registered your public key with GitHub - Select the
mainbranch and choose a directory for the local repository - Import the existing Eclipse projects and click Finish
Import an Existing Clone
If you have already cloned the repository on the command line…
git clone https://github.com/BaseXdb/basex.git
…you can import it via File → Import… → Maven → Existing Maven Projects, and select the directory of your clone.
The basex repository contains the following subdirectories:
basex-coreis the main projectbasex-apicontains the BaseX APIs (XML:DB, bindings in other languages) and HTTP Services (REST, RESTXQ)basex-examplesincludes some example code for BaseXbasex-testscontains several unit and stress tests
If the “Problems” View contains errors or warnings, you may need to switch to Java 21 (Windows → Preferences → Java → Installed JREs).
Start in Eclipse
- Press Run → Run…
- Create a new “Java Application” launch configuration
- Select “basex” as “Project”
- Choose a “Main class” (e.g.,
org.basex.BaseXGUIfor the graphical user interface) - Launch the project via Run
Alternative
You can also use the standalone version of Maven to compile and run the project, or use other IDEs such as IntelliJ IDEA.