gnodet opened a new pull request, #14068:
URL: https://github.com/apache/maven/pull/14068
## Summary
Extend the noun-style accessor pattern — established in `Repository.java`
since 4.1.0 — to the remaining hand-written `@Immutable` API interfaces in
`maven-api-core` and `maven-api-cli`.
## Motivation
Maven 4 API types like `Repository` already use noun-style accessors
(`id()`, `type()`) with deprecated `getId()`/`getType()` defaults for backward
compatibility. This PR applies the same treatment to ~80 getters across ~20
interfaces, bringing the entire hand-written API surface to a consistent style.
## Pattern
For each old `getXxx()` / `isXxx()` abstract method:
```java
// NEW: abstract noun-style (the primary)
@Nonnull
String source();
// OLD: deprecated default delegating to new
@Deprecated(since = "4.2.0", forRemoval = true)
default String getSource() {
return source();
}
```
## Interfaces changed
**Core types:** `Artifact` (snapshot), `Dependency` (optional), `Type`,
`Packaging`
**Service requests:** `Request`, `Result`, `BuilderProblem`,
`RepositoryAwareRequest`, `SettingsBuilderRequest`, `ProjectBuilderRequest`,
`ModelBuilderRequest`, `ArtifactCoordinatesFactoryRequest`,
`ArtifactFactoryRequest`, `ArtifactDeployerRequest`,
`ArtifactInstallerRequest`, `ArtifactResolverRequest`,
`DependencyCoordinatesFactoryRequest`, `DependencyResolverRequest`,
`XmlReaderRequest`
**CLI:** `CIInfo`
## Compatibility
- All deprecated `getXxx()` / `isXxx()` methods remain as `default` methods
that delegate to the new noun-style methods
- External consumers continue to compile and run without changes
- In-tree implementations updated to override the new abstract methods
directly
---
- [x] I hereby declare this contribution to be licensed under the [Apache
License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
_Hermes Agent (Claude) on behalf of Guillaume Nodet_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]