Conversation
Review: Missing spots where namespace is still derived from modelVersionThe PR changes the assumption so that the XML namespace is always 1.
|
| Priority | File | Issue |
|---|---|---|
| Critical | TransformerSupport.java |
Consumer/build POM writer uses String.format(NAMESPACE_FORMAT, version) — will write wrong namespace |
| High | DefaultModelBuilder.java |
modelVersion inference from namespace — behavior change for old 4.1.0-namespaced POMs without explicit modelVersion |
| Medium | maven.mdo |
Namespace template is conceptually version-dependent |
| Low | DefaultModelXmlFactory.java |
Namespace validation still allows old versioned namespaces |
Two additional findings I missed above5.
|
|
something in the maven-shade-plugin is tripping a place I've missed: |
|
working on the first four. On #5 I see the point. It's not immediately obvious to me whether ns or namespace is the namespace of the element. Digging. |
|
I think ChatGPT 4.1 found the cause of the remaining test failure. It's in the maven-shade-plugin where PomWriter tries to construct a namespace rather than simply copying the namespace of the source document: |
Namespaces and model versions are not the same thing and do not serve the same purpose.
This PR has two related effects:
modelVersionelementFixing this opens up Maven to the large and valuable XML toolchain. It makes it much easier for developers to analyze, store, and manipulate pom.xml files from a variety of languages without depending on complex Maven APIs and tooling. It decouples the poms from the Java source code. It is no longer necessary to use Maven libraries to process poms.
On the Maven side, it removes a roadblock to using standard XML parsers like Xerces instead of maintaining a separate custom XML parser. The more we can fit into the standard toolchains, the easier development becomes.
fixes #10692