Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of POM files without namespaces #7

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

artemmukhin
Copy link
Contributor

XmlUtil is strict when matching namespaces, but some very old pom.xml files do not provide any namespace.
This commit introduces a wrapper around XmlReader to handle POM files without namespaces. Now XML.decodePomFromString(String) should be used instead of XML.decodeFromString<ProjectObjectModel>(String).

More information: pdvrieze/xmlutil#170

XmlUtil is strict when matching namespaces, but some very old pom.xml files do not provide any namespace. This commit introduces a wrapper around `XmlReader` to handle POM files without namespaces. Now `XML.decodePomFromString(String)` should be used instead of `XML.decodeFromString<ProjectObjectModel>(String)`.

More information: pdvrieze/xmlutil#170
@artemmukhin artemmukhin requested a review from lamba92 July 24, 2023 13:13
@lamba92 lamba92 merged commit 26d10c6 into master Jul 24, 2023
2 of 3 checks passed
Comment on lines +84 to +86
val namespaceAgnosticReader = object : XmlReader by XmlStreaming.newReader(string) {
override val namespaceURI: String get() = POM_XML_NAMESPACE
}

Choose a reason for hiding this comment

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

Please note that this breaks unqualified attributes (as used by default).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants