Development Guide
This document provides information for developers who want to build, modify, or contribute to the GeoTools library. It covers the development environment setup, build process, continuous integration workflows, and the release process. For information about GeoTools architecture, see Core Architecture.
Development Environment Setup
To work with GeoTools source code, you need to set up a proper development environment.
Prerequisites
The following are required for GeoTools development:
Java Development Kit (JDK):
- Required: JDK 11 (GeoTools 21.x and above)
- Optional: JDK 17 for testing against newer Java versions
Apache Maven: Version 3.5 or newer recommended
Git: For source code management
IDE: Eclipse, IntelliJ IDEA, or other Java IDE (optional but recommended)
Installing Java
GeoTools currently requires Java 11 for development. You can use OpenJDK or Oracle JDK distributions.
# Using SDKMAN (recommended)
sdk install java 11.0.20.1-tem
# Using apt-get
sudo apt-get install openjdk-11-jdkInstalling Maven
Maven is used as the build system for GeoTools.
# Using SDKMAN
sdk install maven
# Using apt-get
sudo apt-get install mavenGit Configuration
Configure Git before working with the GeoTools repository:
git config user.name "Your Name"
git config user.email your.email@example.com
git config --global core.autocrlf inputBuilding GeoTools
Getting the Source Code
git clone https://github.com/geotools/geotools.git
cd geotoolsRepository Structure
Basic Build
To build the entire GeoTools library:
mvn clean installFor a faster build without running tests:
mvn clean install -DskipTestsTo build with all optional modules:
mvn clean install -DallParallel Builds
Maven 3 supports parallel builds to take advantage of multi-core processors:
mvn clean install -Dall -T 2CThe 2C parameter tells Maven to use 2 threads per CPU core.
Building Individual Modules
To build a specific module:
cd modules/library/main
mvn clean installCommon Build Issues
Memory Issues: Increase Maven heap size with
MAVEN_OPTS=-Xmx1024mWindows Path Issues: Issues with directory deletion on Windows often relate to Microsoft Indexing Service
Java Version Mismatch: Ensure your environment is using the correct Java version
Continuous Integration and Testing
GeoTools uses GitHub Actions for continuous integration testing. The CI process ensures code changes don't break existing functionality.
CI/CD Workflow
- .github/workflows/integration.yml1-77
- .github/workflows/linux_jdk11.yml1-47
- .github/workflows/linux_jdk17.yml1-47
- .github/workflows/windows.yml1-38
- .github/workflows/macos.yml1-65
- .github/workflows/qa.yml1-38
Database Integration Tests
Database integration tests verify that GeoTools can connect to various database systems:
- PostgreSQL/PostGIS (
postgis_online.yml) - MySQL (
mysql_online.yml) - Oracle (
oracle_online.yml) - Microsoft SQL Server (
mssql_online.yml) - DB2 (
db2_online.yml) - GeoPackage (
geopkg_online.yml)
These tests are performed on pull requests to ensure compatibility.
- .github/workflows/postgis_online.yml1-70
- .github/workflows/mysql_online.yml1-45
- .github/workflows/oracle_online.yml1-49
- .github/workflows/mssql_online.yml1-43
- .github/workflows/db2_online.yml1-42
- .github/workflows/geopkg_online.yml1-38
Running Tests Locally
To run the tests for GeoTools:
mvn testTo run a specific test class:
mvn -Dtest=YourTestClass testFor testing against online resources like databases, use the online profile:
mvn test -PonlineRelease Process
The GeoTools release process involves several steps to ensure quality and consistency.
Release Workflow
- docs/developer/procedures/release.rst1-158
- build/release/build_release.sh1-205
- build/release/publish_release.sh1-105
Release Prerequisites
The following are necessary to perform a GeoTools release:
- Commit access to the GeoTools Git repository
- Build access to Jenkins
- Edit access to the GeoTools Blog
- Administration rights to GeoTools JIRA
- Release/file management privileges in SourceForge
Building a Release
The release build is performed using the build_release.sh script which:
- Checks out the appropriate branch
- Updates version numbers in all files
- Builds the release artifacts
- Creates a tag for the release
Example usage:
./build/release/build_release.sh -b 28.x 28.1 username email@example.com stablePublishing a Release
The publish_release.sh script handles:
- Deploying to the Maven repository
- Uploading artifacts to SourceForge
Example usage:
./build/release/publish_release.sh 28.1 28.x username email@example.comCreating and Announcing Release Notes
After publishing:
- Generate release notes from JIRA
- Create a GitHub release with the release notes
- Announce on GeoTools Blog
- Email the mailing lists:
Contributing to GeoTools
Contribution Workflow
Contribution Guidelines
When submitting contributions:
- Talk First Policy: Discuss your changes on the developer mailing list first
- Include Tests: Always include test cases for your changes
- Follow Conventions: Adhere to GeoTools coding conventions
- Proper Commits: Use proper commit messages referencing JIRA issues
- Submit Pull Requests: Submit your changes as GitHub pull requests
- Sign CLA: For non-trivial changes, submit a Contribution License Agreement
Pull Request Requirements
Pull requests should:
- Target the
mainbranch (backports handled later) - Include tests covering the changes
- Update documentation if the change is visible to end users
- Reference a JIRA issue in the commit message
- Present small, focused changes (one objective per commit)
Community Resources
Mailing Lists
Users List: geotools-gt2-users@lists.sourceforge.net
- For questions about using GeoTools
Developer List: geotools-devel@lists.sourceforge.net
- For development discussions
Issue Tracker
GeoTools uses JIRA for issue tracking:
Developer Chat
Matrix/Gitter: https://matrix.to/#/#geotools_geotools:gitter.im
Commercial Support
Commercial support options are available for users with deadlines or requiring professional assistance:
Camptocamp
GeoSolutions
Ian Turton, UK
Build Server
The GeoTools codebase is monitored by a build server that schedules a compile after each commit:
This Development Guide provides an overview of the key tools and processes for working with the GeoTools codebase. By following these guidelines, you'll be able to effectively build, test, and contribute to the GeoTools project.