Skip to content

Backport #11742: Fix #11715: preserve 4.1.0 namespace/schema in help:effective-pom#12255

Merged
gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:cherry-pick-11742-to-4.0.x
Jun 13, 2026
Merged

Backport #11742: Fix #11715: preserve 4.1.0 namespace/schema in help:effective-pom#12255
gnodet merged 1 commit into
apache:maven-4.0.xfrom
gnodet:cherry-pick-11742-to-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Backport of #11742 to 4.0.x branch.

@gnodet gnodet added the bug Something isn't working label Jun 13, 2026
@gnodet gnodet force-pushed the cherry-pick-11742-to-4.0.x branch from ddb53db to ba1b092 Compare June 13, 2026 08:24
…om (apache#11742)

* Fix apache#11715: preserve 4.1.0 namespace/schema in help:effective-pom

When generating the effective POM for a modelVersion 4.1.0 project,
preserve the root <project> namespace and schemaLocation as 4.1.0
instead of falling back to 4.0.0.

Add/keep coverage with MavenITgh11715EffectivePomNamespaceTest to
verify the effective POM header contains:
- xmlns http://maven.apache.org/POM/4.1.0
- schemaLocation .../maven-4.1.0.xsd

* Extract XmlService classloader fix and use MavenModelVersion

- Remove XmlService classloader fallback (extracted to PR apache#12237)
- Use MavenModelVersion to compute the minimum model version
  instead of hardcoding 4.0.0 as the fallback
- Align namespace/schemaLocation format strings with
  TransformerSupport conventions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Remove super(versionRange) call — AbstractMavenIntegrationTestCase has no String constructor

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Use declared modelVersion for namespace, fall back to MavenModelVersion

MavenModelVersion computes the minimum required version based on
features, but help:effective-pom should preserve the version declared
in the POM. Use model.getModelVersion() first and only fall back to
MavenModelVersion when the version is not explicitly set.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet force-pushed the cherry-pick-11742-to-4.0.x branch from ba1b092 to cc45e3f Compare June 13, 2026 08:37
@gnodet gnodet added this to the 4.0.0-rc-6 milestone Jun 13, 2026
@gnodet gnodet merged commit 5bdb653 into apache:maven-4.0.x Jun 13, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants