Skip to content

Use conventional verb method names in XmlNode - #11583

Draft
elharo wants to merge 22 commits into
masterfrom
11582
Draft

Use conventional verb method names in XmlNode#11583
elharo wants to merge 22 commits into
masterfrom
11582

Conversation

@elharo

@elharo elharo commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

fixes #11582

@slachiewicz

Copy link
Copy Markdown
Member

@elharo we are close to cut maven 4, what is plan for this change?

@elharo elharo changed the title 11582 Use verb method names in XmlNode Aug 31, 2026
@elharo elharo changed the title Use verb method names in XmlNode Use conventional verb method names in XmlNode Aug 31, 2026
@elharo

elharo commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Let me see what I can do about this. It's a mess because of a Modello.

@elharo

elharo commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

ATM I'm stymied by a weird case where org.codehaus.plexus.util.xml.Xpp3Dom depends on XmlNode. That dependency seems to be running the wrong direction. Nothing in plexus should depend on Maven.

@slachiewicz

Copy link
Copy Markdown
Member

@elharo In Maven 4, the relationship between Plexus and Maven XML was inverted by design:

  • org.apache.maven.api.xml.XmlNode is the immutable core API in Maven 4.
  • plexus-xml 4.x was created specifically as a backward-compatibility bridge for legacy plugins—org.codehaus.plexus.util.xml.Xpp3Dom in plexus-xml 4.x wraps and delegates to XmlNode.

Because plexus-xml is an external dependency (codehaus-plexus/plexus-xml), modifying or removing existing method names on XmlNode breaks compatibility with the released plexus-xml 4.x artifacts.

Given that we are close to cutting the Maven 4 release:

  1. We should avoid breaking changes to XmlNode at this stage (or only add getter aliases as default methods rather than renaming existing ones).
  2. Otherwise, this would require coordinating a release of plexus-xml before we can integrate changes here.

What do you think about either adding default getter methods alongside the current methods or deferring this cleanup post-4.0?

@elharo

elharo commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author
  1. XmlNode is marked Experimental.
  2. It only gets harder to change after we ship.
  3. Plexus is an ugly mess for historical reasons We really shouldn't be depending on it at all, but in the meantime we certainly shouldn't be adding new pieces there.
  4. If plexus-xml 4.x is only for compatibility the Maven 4 code shouldn't depend on it. That ius something else to fix and yet another release blocker.

I frankly do not believe Maven 4 is in good enough shape to release. XmlNode is hardly the only problem we need to fix while we can.

@elharo

elharo commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

As a stopgap measure, we might add the getter methods as need and definitely undeprecate them, and we should instead deprecate the no-get methods.

@slachiewicz

Copy link
Copy Markdown
Member

Feel free to open changes to plexus-xml
I've spent there lots of time to cleanup stuff and migrate to mvn4 API.
I'm not sure if I understand this problem so better would be if you can open pr and then I can do quicky release.

@elharo

elharo commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

The problem is that the repo https://github.com/apache/maven depends on plexus-xml which depends on Maven. I.e. there's a cycle between the repos if not the artifacts. This is a problem irrespective of the names of these methods. It might require several releases to untangle this.

@gnodet

gnodet commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Same as #13032 — this change is not desired. The record-accessor naming is intentional for immutable value types in the Maven 4 API.

See #11582 (comment) for the full rationale.

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.

Noun method names in XmlNode

3 participants