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

Strict XML parser breaks Maven backward compatibility #238

Closed
cstamas opened this issue Feb 21, 2023 · 6 comments
Closed

Strict XML parser breaks Maven backward compatibility #238

cstamas opened this issue Feb 21, 2023 · 6 comments

Comments

@cstamas
Copy link
Member

cstamas commented Feb 21, 2023

This change:
761ac42

The p-u XML parser is made stricter, and adhere standard, which is fine, but there is a problem: older Maven versions were able to parse, hence build and deploy projects that used POMs that does not adhere to strict(er) XML parsing. If it happens for user to pick up such POM (ie. among transitive dependencies), there is no breakout for user from that situation.

Also, see issue https://issues.apache.org/jira/browse/MNG-7697

Proposal: add some "lax-standards" switch for this. I agree that project POMs should fully adhere to XML 1.0 (so MNG-7697 is IMHO a fluke), but dependency POMs should be parsed with "laxed" standards, just like dependency POMs validation is laxed as well, given they are probably built and deployed with Maven versions pre-3.9.0, and MAY contain invalid characters as those versions would allow emojis in comments...

ping @belingueres

@cstamas cstamas added bug and removed bug labels Feb 21, 2023
@michael-o
Copy link
Member

I imagine a system property for this...

@cstamas
Copy link
Member Author

cstamas commented Feb 21, 2023

Why a system property? Am fine to keep strict XML 1.0 parsing for project POM, but lax parsing for dependency POMs... how would a system property help here?

@michael-o
Copy link
Member

michael-o commented Feb 21, 2023

Why a system property? Am fine to keep strict XML 1.0 parsing for project POM, but lax parsing for dependency POMs... how would a system property help here?

How is Plexus supposed to make the difference?

@slawekjaranowski
Copy link
Member

can be couse of mojohaus/build-helper-maven-plugin#168

@belingueres
Copy link
Contributor

Hi:
Sorry for the late reply.
@cstamas : I confirm that change is detecting the emoji as an invalid character.
@slawekjaranowski: the mojohaus/build-helper-maven-plugin#168 I confirm this is a bug. I'll be working on this issue first.

gnodet added a commit to gnodet/plexus-utils that referenced this issue Mar 1, 2023
@gnodet
Copy link
Member

gnodet commented Mar 1, 2023

Hi:
Sorry for the late reply.
@cstamas : I confirm that change is detecting the emoji as an invalid character.

Fixed with #240

@slawekjaranowski: the mojohaus/build-helper-maven-plugin#168 I confirm this is a bug. I'll be working on this issue first.

Fixed with takari/polyglot-maven#259 / eclipse-tycho/tycho#2176 . I don't think this is an issue for the mx parser.

@belingueres fwiw

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

No branches or pull requests

5 participants