<!--
title: Alphabetical ordering requirement
domain: app-frameworks
topic: Code Style
language: Other
source: spring-projects/spring-boot
updated: 2024-09-30
url: https://awesomereviewers.com/reviewers/spring-boot-alphabetical-ordering-requirement/
-->

Always maintain alphabetical ordering for lists of elements including dependencies, modules, configuration entries, and other similar collections. This convention improves code organization, makes it easier to locate items, prevents duplications, and ensures consistency across the codebase.

When adding new elements to existing lists, ensure they are placed in the correct alphabetical position:

```gradle
dependencies {
  // Correct: alphabetically ordered
  dockerTestRuntimeOnly("com.ibm.db2:jcc")
  dockerTestRuntimeOnly("io.r2dbc:r2dbc-mssql")
  dockerTestRuntimeOnly("org.postgresql:postgresql")
  dockerTestRuntimeOnly("org.postgresql:r2dbc-postgresql")
  
  // Incorrect: not alphabetically ordered
  dockerTestRuntimeOnly("io.r2dbc:r2dbc-mssql")
  dockerTestRuntimeOnly("org.postgresql:postgresql")
  dockerTestRuntimeOnly("org.postgresql:r2dbc-postgresql")
  dockerTestRuntimeOnly("com.ibm.db2:jcc")  // Wrong position
}
```

This rule applies to all list-like structures including gradle dependencies, spring.factories entries, module definitions, and similar configuration files throughout the project.
