gnodet opened a new pull request, #14067:
URL: https://github.com/apache/maven/pull/14067
## Summary
Modify the shared Modello Velocity template (`model.vm`) so all generated
model classes across the 6 API modules now emit **noun-style accessors**
alongside deprecated JavaBeans-style getters.
### What changes
For every generated field, the template now produces **two methods**:
1. **Noun-style accessor** (primary):
```java
public String groupId() {
return this.groupId;
}
```
2. **Deprecated JavaBeans getter** (delegates to noun accessor):
```java
@Deprecated(since = "4.2.0", forRemoval = true)
public String getGroupId() {
return groupId();
}
```
For boolean fields, `isFieldName()` delegates to `fieldName()`.
The root-class methods `getNamespaceUri()` and `getModelEncoding()` are also
deprecated in favor of `namespaceUri()` and `modelEncoding()`.
### What is NOT changed
Infrastructure/location-tracking methods are intentionally excluded:
- `getLocation(Object)`, `getLocationKeys()`, `getLocationKeyStream()`,
`getLocations()`, `getImportedFrom()`
### Affected modules
All 6 modules sharing `model.vm`:
- `api/maven-api-model`
- `api/maven-api-settings`
- `api/maven-api-toolchain`
- `api/maven-api-metadata`
- `api/maven-api-plugin`
- `api/maven-api-cli`
### Prior art
This aligns generated model classes with the noun-style accessor convention
already established for Maven 4 API types like `Repository`, `Session`, and
other `@Immutable` interfaces (since 4.1.0). The model classes — also
`@Immutable` — were the last holdout using JavaBeans-style getters.
### Compatibility
- All existing callers continue to compile — the deprecated `getXxx()`
methods still exist and delegate to the new `xxx()` accessors
- Full build passes (`mvn install -T1C -DskipTests`)
- Spotless passes
- Unit tests pass (175 tests in maven-model alone)
- japicmp shows no binary compatibility regression
---
I hereby declare this contribution is licensed under the Apache License 2.0.
--
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]