Skip to content
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

groovy-eclipse-compiler: Allow using "release" and "source/target" together #1604

Open
TobiX opened this issue Dec 4, 2024 · 2 comments
Open
Labels

Comments

@TobiX
Copy link

TobiX commented Dec 4, 2024

To simplify configuration for users still using Java 8 (yes, I know, I know), plexus-compiler 2.15.0 automatically filters the release parameter from the call to javac if it is < 9. This was merged into Maven compiler 3.13.0 (https://issues.apache.org/jira/browse/MCOMPILER-582) and Maven Javadoc 3.11.1 (https://issues.apache.org/jira/browse/MJAVADOC-787).

If I try to use the same simplified configuration with the groovy-eclipse-compiler, it complains instead:

16:09:38  [INFO] Recompiling the module because of changed dependency.
16:09:38  [INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
16:09:38  [INFO] option --release is supported only when run with JDK 9 or above

It would be nice if it behaved the same as the other Maven plugins.

(See also the updated documentation: https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-release.html#usage-on-jdk-8)

@eric-milles
Copy link
Member

Release support changes: #894 #896

Does the conditional configuration not work? If you can give release a blank value for JDK 8, groovy-eclipse-compiler will pass source and target.

The rub here is how to detect that tooling supports release or source/target. The tycho-compiler-plugin offers a special option for this: https://tycho.eclipseprojects.io/doc/2.7.5/tycho-compiler-plugin/compile-mojo.html#deriveReleaseCompilerArgumentFromTargetLevel

@eric-milles
Copy link
Member

Can you give this a try? I did what plexus-compiler did to determine the java version. I have not tested with all three config elements.

groovy-eclipse-compiler-3.9.1-SNAPSHOT.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants