-
Notifications
You must be signed in to change notification settings - Fork 61
"release" parameter should only be set for javac version >= 9 #140
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
Comments
This should be done at maven-compiler-plugin level, to ensure that every compiler implementation gets the same set of arguments. The more I think about it, the more it looks like https://issues.apache.org/jira/browse/MCOMPILER-270 from almost 5 years ago. |
IMHO plexus-compiler and m-compiler-p is a higher level abstraction and therefore should try to translate the intent of the parameter into the compiler specific flags. Release is clearly a parameter for javac >= 9 but does mot make sense for earlier versions nor for some other compilers. |
a lot of code in JavacCompiler related to Java < 8 can be deleted |
I don't think so. Keep in mind that you can still use toolchain, and best practice is to use the targeted JDK to compile. |
Sometimes it is difficult to set up the plugin configuration in a way to support different JDKs (maybe even using toolchains). For example look at MPOM-264. To ease that the JavacCompiler should only use the
-release
parameter with version 9 or above as using it with earlier versions leads to errors.An additional condition should be added to
plexus-compiler/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java
Line 344 in 0a0aab0
The text was updated successfully, but these errors were encountered: