-
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
Clear project.build.sourceEncoding
after parsing sources
#735
Clear project.build.sourceEncoding
after parsing sources
#735
Conversation
@timtebeek Thank you! I confirm that this patch does solve by issue. |
src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/maven/MavenMojoProjectParser.java
Outdated
Show resolved
Hide resolved
JavaParser.Builder<? extends JavaParser, ?> javaParserBuilder = JavaParser.fromJavaVersion() | ||
.styles(styles) | ||
.logCompilationWarningsAndErrors(false); | ||
|
||
Object mavenSourceEncoding = mavenProject.getProperties().get("project.build.sourceEncoding"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we would also accept the encoding from the compiler plugin configuration: https://www.baeldung.com/maven-encoding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 175d711 , thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you able to check if the precedence is correct between the plugin configuration and the project property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard to find any exact sources on what takes precedence, but reading this it's likely the plugin indeed.
https://maven.apache.org/plugins/maven-resources-plugin/examples/encoding.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the detail in my comment this LGTM.
What's your motivation?
Anything in particular you'd like reviewers to focus on?
Wasn't sure if this exactly captures the issue described in #734 ; from the description there this seemed a good first step.
Anyone you would like to review specifically?
@leveretconey
Have you considered any alternatives or workarounds?
Not really sure we have a lot of other options here; but open to help explore.