Skip to content

Conversation

@andrzejj0
Copy link
Contributor

@andrzejj0 andrzejj0 commented Oct 4, 2025

  • Extended the API for the updates logger
  • New, appendable xml schema which allows recording multiple executions of the plugin
  • Added json and csv

The change logger updates are now generated using an XSD schema rather than using Modello. The primary reason was the ability to easily (de)serialize using multiple formats + extensibility.

The ultimate goal of this is to use this change logger model to actually transmit updates in "display" targets as well, so that both "display" and "change" targets share the common backend.

I know it's going to be a large one, so I'm doing this in stages. First stage is this updates overhaul.

@slawekjaranowski please review

Edit: it's actually not breaking since the old API is made deprecated, but is still there, to be retired.

Edit2: I did test the site. ;)

@andrzejj0 andrzejj0 self-assigned this Oct 4, 2025
@andrzejj0 andrzejj0 added this to the 2.20.0 milestone Oct 4, 2025
@andrzejj0 andrzejj0 force-pushed the updates-xsd branch 3 times, most recently from 7925f48 to b9e1ff6 Compare October 10, 2025 19:01
@andrzejj0 andrzejj0 force-pushed the updates-xsd branch 2 times, most recently from 1b35363 to 8bdc23a Compare October 12, 2025 17:32
@andrzejj0 andrzejj0 removed this from the 2.20.0 milestone Oct 19, 2025
@andrzejj0 andrzejj0 force-pushed the updates-xsd branch 2 times, most recently from dc693cf to c12f66e Compare October 19, 2025 15:13
@andrzejj0 andrzejj0 marked this pull request as draft October 26, 2025 10:22
@andrzejj0
Copy link
Contributor Author

Will add an example of change recorder logs to DisplayDependencyUpdates.

@andrzejj0 andrzejj0 marked this pull request as ready for review October 27, 2025 08:48
@andrzejj0 andrzejj0 linked an issue Oct 27, 2025 that may be closed by this pull request
@andrzejj0 andrzejj0 added this to the 2.20.0 milestone Oct 27, 2025
@andrzejj0 andrzejj0 requested a review from Copilot October 27, 2025 16:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR comprehensively overhauls the updates logger by extending the API and introducing new serialization formats. The key changes include:

  • Migration from Modello to JAXB for XML schema generation, enabling multi-format serialization
  • Introduction of new XML schema (3.0) with appendable execution records
  • Addition of JSON and CSV output formats alongside the existing XML format
  • Refactoring of change recording from a single ChangeRecorder interface to a factory-based VersionChangeRecorderFactory pattern
  • Deprecation of old API while maintaining backwards compatibility

Reviewed Changes

Copilot reviewed 149 out of 150 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
versions-model/src/main/resources/xsd/updates-3.0.xsd New XSD schema v3.0 supporting appendable execution logs with metadata
versions-model/src/main/resources/xsd/bindings.xjb JAXB bindings configuration for schema-to-Java generation
versions-model/src/main/java/org/codehaus/mojo/versions/model/xjb/ZonedDateTimeXmlAdapter.java Custom JAXB adapter for ZonedDateTime serialization
versions-test/src/main/java/org/codehaus/mojo/versions/utils/TestVersionChangeRecorder.java Refactored test recorder implementing new VersionChangeRecorder interface
versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/AbstractVersionsUpdaterMojo.java Updated to use factory pattern and support multiple output formats
versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/UseLatestVersionsMojoBase.java Refactored to use new DependencyVersionChange model
versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DisplayPropertyUpdatesMojo.java Added change recording for display mojos

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 149 out of 150 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@slachiewicz
Copy link
Member

Maybe we can use jakarta instead of javax? If it's not a big deal now?

@andrzejj0
Copy link
Contributor Author

andrzejj0 commented Nov 1, 2025

Maybe we can use jakarta instead of javax? If it's not a big deal now?

I tried, but I think that is not possible: we still support Java 8. https://github.com/andrzejj0/versions-maven-plugin/actions/runs/18996348155/job/54256770147

javax.xml.bind:jaxb-api:2.3.1 is the last version that supports Java 8, but it is only compatible with javax.

@andrzejj0 andrzejj0 requested a review from slachiewicz November 1, 2025 12:19
@andrzejj0
Copy link
Contributor Author

However, it's easy to do it when we eventually drop Java 8 support (some day).
Meanwhile, added you to reviewers.

Your Copilot PR would still need to use this new change recorder to record changes, but that's pretty straightforward (a prompt away).

…new appendable xml which records multiple executions

Added changeRecorder to display-property-updates, display-parent-updates, display-dependency-updates, display-extension-updates, display-plugin-updates;
Added changeRecorder to display-property-updates, display-parent-updates, display-dependency-updates, display-extension-updates
@slachiewicz slachiewicz removed their request for review November 14, 2025 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple executions of display-X-updates overwrite outputFile

3 participants