Provide clearer link between documented managed dependency coordinates and version properties#49222
Conversation
Signed-off-by: Dinesh Suthar <dineshsld20@gmail.com>
6d097c9 to
630a527
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves the dependency versions appendix docs by cross-linking the “Version Properties” and “Managed Dependency Coordinates” pages and by enriching the generated managed-coordinates table so readers can see which version properties control which managed dependencies.
Changes:
- Add reciprocal xrefs between the Version Properties page and the Managed Dependency Coordinates page.
- Update the generated managed dependency coordinates table to include a new “Version Property” column.
- Enhance the buildSrc documentation task to associate managed dependencies with their library’s version property (including multiple properties when applicable).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| documentation/spring-boot-docs/src/docs/antora/modules/appendix/pages/dependency-versions/properties.adoc | Adds a link to the managed coordinates page to show what each property can affect. |
| documentation/spring-boot-docs/src/docs/antora/modules/appendix/pages/dependency-versions/coordinates.adoc | Documents the new “Version Property” column and links back to the properties list. |
| buildSrc/src/main/java/org/springframework/boot/build/docs/DocumentManagedDependencies.java | Extends the generated coordinates table with version property data and updates generation logic accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| writer.printf("| `%s`%n", id.groupId()); | ||
| writer.printf("| `%s`%n", id.artifactId()); | ||
| writer.printf("| `%s`%n", id.version()); | ||
| writer.println(formatVersionProperties(entry.getValue())); |
There was a problem hiding this comment.
ResolvedBom.Id includes a classifier, but this task’s ordering/keying logic (and the generated table columns) ignore it. If the BOM contains managed dependencies that differ only by classifier (e.g., artifacts declared with classifier = 'jakarta'), they can be merged into a single row and the generated documentation will lose information or associate the wrong set of version properties. Consider either including classifier in the table (add a column) and in the map’s comparator, or normalizing/encoding classifier into the output so classifier-specific coordinates remain distinct.
| Map<Id, Set<String>> managedCoordinates = new TreeMap<>((id1, id2) -> { | ||
| int groupComparison = id1.groupId().compareTo(id2.groupId()); | ||
| if (groupComparison != 0) { | ||
| return groupComparison; | ||
| } | ||
| return id1.artifactId().compareTo(id2.artifactId()); | ||
| int artifactComparison = id1.artifactId().compareTo(id2.artifactId()); | ||
| if (artifactComparison != 0) { | ||
| return artifactComparison; | ||
| } | ||
| return id1.version().compareTo(id2.version()); | ||
| }); |
There was a problem hiding this comment.
The comparator passed to TreeMap duplicates ResolvedBom.Id#compareTo (groupId/artifactId/version ordering). Duplicating the ordering logic makes future changes easy to miss and can lead to subtle ordering/keying inconsistencies. Prefer relying on Id’s natural ordering (for example, using a plain new TreeMap<>() or Comparator.naturalOrder()).
This PR improves the documentation by clearly linking managed dependency
coordinates with their corresponding version properties.
Closes gh-43821.