-
Notifications
You must be signed in to change notification settings - Fork 107
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
Compiler options in pom.xml are not obeyed #1709
Comments
I don't think the language server is responsible for compiling so I'm a bit confused what m2e (and Eclipse IDE extension" should do here... |
I'm not sure either :) but I was directed here by the RedHat Language Support for VSCode extension maintainers. Here's my scenario: I have inherited a large legacy Java project, and I need to modernize it. When compiling with Java 21, thousands of warnings are produced. I can't address them all at once, so I have configured the compilation step in my
When compiling via When I open the project in VSCode, the Java Language Support extension (that uses M2E apparently?) ignores these compiler settings, and produces thousands of warnings/errors, making it nigh impossible to use the IDE language server features to work on the code. IMO, whatever part of the extension is compiling/interpreting/linting/scanning the source code should be obeying the javac compiler options specified in the I hope that helps explain the situation. |
I know that m2e passes options to jdt that the compiles the code in eclipse, maybe it works the same in vscode :-) |
As I mentioned in the original issue, the problem comes from the Java configurator which doesn't map javac lint flags to their JDT equivalent. It currently only maps the So more javac flags need to be handled there. PRs are welcome. |
VSCode with the RedHat Language Support for Java extension (which apparently uses M2E under the covers) does not obey all
javac
compiler options specified in the Mavenpom.xml
when compiling projects.Environment
Steps To Reproduce
mvn compile
. Note that no errors or warnings are produced.Sample project:
https://github.com/paulmedynski/vscode-java-compiler-args
Current Result
VSCode produces compiler errors and warnings that are disabled in
pom.xml
.Expected Result
VSCode compiles the project with the same compiler options specified in
pom.xml
.Notes
Aso note that some other compiler options, such as
--add-exports
are also not obeyed. I'm not going to test every possible javac compiler option, but M2E should support them all, shouldn't it?This issue was originally logged against the RedHat Language Support for Java extension here:
redhat-developer/vscode-java#3518
I was asked to open this issue against M2E by the extension maintainers.
The text was updated successfully, but these errors were encountered: