GeoServer Cloud

Dockerized GeoServer micro-services

View the Project on GitHub

Coding Standards and Style Guidelines

GeoServer Cloud follows a set of coding standards to ensure code consistency and quality across the project. This document outlines the key standards and how they are enforced.

Contents

Introduction

Code style consistency is enforced using automated tools during the build process. The project uses a build-tools module approach, similar to other major Java projects like Apache Commons, Spring Framework, and Hibernate, to centralize style configuration.

Checkstyle Configuration

Checkstyle is used to enforce consistent code style and formatting standards. The configuration is located in the build-tools module.

Key Style Rules

Configuration Files

The Checkstyle configuration is stored in the following files:

Code Formatting

In addition to Checkstyle, the project uses:

Running Style Checks

Style checks are run as part of the build process. You can trigger them manually with:

# Run all checks
mvn validate -Dqa -fae -ntp -T1C

# Run only Java formatting checks
mvn validate -Dqa -fae -Dsortpom.skip=true -ntp -T1C

# Run only POM checks
mvn validate -Dqa -fae -Dspotless.skip=true -Dcheckstyle.skip=true -ntp -T1C

Fixing Style Issues

To automatically fix style issues:

# Format all files
make format

# Format only Java files
make format-java

# Format only POM files
make format-pom

Integration with IDE

Most common IDEs can be configured to follow these style guidelines:

IntelliJ IDEA

Eclipse

VS Code