Apache Software Foundation / Maven Core
Merged upstreamFeatureSelected contributionMerged Sep 18, 2026

Add a settings parser SPI

Introduced a SettingsParser SPI with XML as the default implementation, preserving interpolation, decryption, validation, restrictions, and merging in DefaultSettingsBuilder.

apache/maven · #13118

Extension API improvement

Maven extensions can parse settings from alternative syntaxes without replacing the complete settings-building pipeline.

Problem

Supporting YAML, properties, or another settings syntax previously required replacing too much of Maven's SettingsBuilder instead of extending only source parsing.

Approach

Selects one supporting parser per Source, retries strict parse failures leniently while preserving warnings, reports ambiguous providers as structured fatal problems, and catches provider failures with source and provider diagnostics. File-backed and in-memory sources are supported.

Impact and scope

  • Creates a narrow extension point for alternative settings formats while retaining Maven's shared settings semantics.
  • Keeps XML fallback as the default and produces deterministic diagnostics for ambiguous or failing providers.
  • Discovery and extension loading are unchanged: a parser must already be available to the container reading settings and cannot bootstrap itself from the settings it needs to parse.

Validation

  • Unit coverage verifies parser selection, diagnostics, exceptions, strict-to-lenient retry, and XML fallback.
  • Core integration tests exercise extension-classpath parsing, core-realm parsing, XML fallback, and the bootstrap limitation.
  • GitHub full-build and integration-test matrices passed across Linux, macOS, Windows and JDK 17/21/25. The issue is closed and the verified merge commit credits Goutam Adwant.