-
Notifications
You must be signed in to change notification settings - Fork 71
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
Mistake in detecting encoding of pom.xml #734
Comments
Thanks for calling this out @leveretconey ! Sounds like an oversight; adding a bit of context here already. We indeed read rewrite-maven-plugin/src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java Lines 162 to 178 in 2a2d1f6
At the point where we read If the problem you're described only affects files outside Would you be able to give that a go and see if that helps you there? |
Thanks for your reply @timtebeek ! Let me add how we are currently using the MavenMojoProjectParser: Currently we set I have tested #735 and that does solve my issue. |
Hi @leveretconey ; did you you have a chance to try out the latest snapshot already? I'm hoping this is now fixed for you, but would like to be sure. |
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
pom.xml of the project:
In a legacy application that java source files are using gbk encoding while pom.xml is using utf-8 encoding, OpenRewrite has recognized the file encoding of pom.xml as gbk. This leads to some problem in our scenerio.
After some debugging, I noticed that OpenRewrite reads
project.build.sourceEncoding
property from pom and sets it as the encoding of all files in this project. I think this behavior is not correct because this property is only applicable to source code files by Maven's design.What did you expect to see?
pom.xml should be detected as using utf-8 encoding
What did you see instead?
pom.xml is detected as using gbk encoding
Are you interested in contributing a fix to OpenRewrite?
I won’t contribute to this because the code changes may be huge and involve multiple code repositories.
The text was updated successfully, but these errors were encountered: