You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: encoding error when parsing a ISO-8859-1 pom with Maven Resolver #163
Maven Resolver (at least the 3.6.0 one) model processor uses ReaderFactory#newXmlReader to create a XmlStreamReader and then pass it to MXParser.
Problem is that since 1e18ddc MXParser assumes the input encoding is UTF8 and only changes that if the input reader is a InputStreamReader (which is not the case here since it's a XmlStreamReader). So we end up with exception:
UTF-8 BOM plus xml decl of ISO-8859-1 is incompatible
This whole check is not really needed here since XmlStreamReader is taking care of potential encoding issues already from what I understand.
Activity
michael-o commentedon Aug 9, 2021
Will take a look. Is your POM public?
tmortagne commentedon Aug 9, 2021
Yes, in my case the problem was with https://repo1.maven.org/maven2/org/apache/commons/commons-parent/39/commons-parent-39.pom (when resolving the parents of
commons-collections:commons-collections:3.2.2to build its Model).michael-o commentedon Aug 9, 2021
@belingueres Can you have a look at this?
tmortagne commentedon Aug 9, 2021
I feel like
MXParser#fileEncodingshould be null by default instead of the arbitrary "UTF8" and the check should be done only if it's not null.michael-o commentedon Aug 9, 2021
So it should autodiscover the encoding itself?
tmortagne commentedon Aug 9, 2021
No, just not compare the encoding with the declaration when it does not know what encoding the reader uses, same as before this change.
michael-o commentedon Aug 9, 2021
Makes sense.
belingueres commentedon Aug 9, 2021
I'll take a look at it.
Fixes codehaus-plexus#163: Regression: encoding error when parsing a …
haster commentedon Aug 26, 2021
We just ran into the same issue and after a bit of searching found the bug ... only to then see this issue that perfectly captures what's going on 😄
Thanks for raising it @tmortagne and for the quick fix @belingueres , can we expect a patch soon?
olamy commentedon Aug 26, 2021
closes by belingueres@f999bdb
olamy commentedon Aug 26, 2021
releasing today
Fixes #163: Regression: encoding error when parsing a ISO-8859-1 xml (#…
Fixed regressions:
Fixed regressions:
Fixed regressions:
Fixed regressions:
Fixed regressions: