Main Page » Developer Section » Developing with Eclipse

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

  1. In the Package Explorer, right-click and choose Import…
  2. Select GitProjects from Git (with smart import) and click Next
  3. Choose Clone URI. The local copy will include the full project history
  4. 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
  5. Select the main branch and choose a directory for the local repository
  6. 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 FileImport…MavenExisting Maven Projects, and select the directory of your clone.

The basex repository contains the following subdirectories:

  1. basex-core is the main project
  2. basex-api contains the BaseX APIs (XML:DB, bindings in other languages) and HTTP Services (REST, RESTXQ)
  3. basex-examples includes some example code for BaseX
  4. basex-tests contains several unit and stress tests

If the “Problems” View contains errors or warnings, you may need to switch to Java 21 (WindowsPreferencesJavaInstalled JREs).

Start in Eclipse

  1. Press RunRun…
  2. Create a new “Java Application” launch configuration
  3. Select “basex” as “Project”
  4. Choose a “Main class” (e.g., org.basex.BaseXGUI for the graphical user interface)
  5. 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.


⚡Generated with XQuery