-
Notifications
You must be signed in to change notification settings - Fork 193
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
Add support for Java 9 to Groovy-Eclipse Maven plugin (aka batch compiler) #265
Comments
I'm not sure where Java 9 support begins and ends exactly. You may need to bootstrap modules to the classpath for this to work with the 2.4.3 compiler. In development we have the 2.4.8 compiler in place. Not sure if it has better support. We'd need to get a release of it so you could reference it in your POM. |
As soon as Eclipse Oxygen 4.7.1a is released, I will publish a Java 9 compatible batch compiler. |
Eclipse Oxygen 4.7.1a has been released. |
Batch compiler 2.4.12-05 is available from bintray. There are a couple hitches that require a few changes to your POM. If you follow these instructions to get to a stable Java 8 build, you can make the following changes to get Java 9 to go. Be sure to adjust any existing Maven run configurations to use a Java 9 execution environment. <properties>
<maven.compiler.fork>false</maven.compiler.fork>
<maven.compiler.source>9</maven.compiler.source>
<maven.compiler.target>9</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<compilerArgument>${maven.compiler.source}</compilerArgument>
</configuration>
... Until this bug is resolved, the compliance level must be passed in as an argument, which is what If you want to run with a forked compiler, I believe the You should be able to add modules to the compilation modulepath with |
Thank you! It seems like there may be a regression in this new version of the compiler. I get a compiler error that I didn't previously get, which seems invalid. I have a Groovy class that looks like this:
which I then static import into another Groovy class as follows:
And I am getting the following compile error:
Adding the "public" modifier to 'static final String[] DESKTOP_AGENTS = ["blah"]' fixes the error, but it doesn't seem like I should have to do that... Any idea what might be going on? Note, I'm using JDK8, not JDK9. |
The issue you mention was raised as #336. Without the public modifier, Groovy creates a private field of the given name and a public accessor method. The import checking occurs against the field and not the accessor. If I were to disable the checking that is at play here, some other added checks like null annotations would also go away. That is why I recommend the |
Hi! I'm trying to use
It seems to be fixed in this issues: 4.8M2 is out some days ago, according to this plan My question is - is there any place to get snapshot build of batch compiler with all latest changes? I've tried this https://build.spring.io/browse/GRECLIPSE-GE47 but without any luck. Maybe I'm looking in a wrong place? Thank you! |
Eclipse 4.8M2 does not contain the Java 9 support. I think M3 will have it. If you don't need Java 9 support, 2.4.12-04 should work better. If you wish to create an updated compiler artifact, you can clone this repository and get a zip of JDT Core at any commit you like. When you diff the org.eclipse.jdt.core project between the two, you would move in any changes that are not marked as Then the steps to create a new batch compiler are here. The batch compiler is not built as part of the CI builds. |
I'm using the following configuration with java 9 build 156
But I still get the error
Where javax/xml/transform/TransformerException is a class present in the java 9 module called java.xml. The above works with the maven compiler plugin.
Am I doing something wrong or is java 9 not supported yet?
Thanks!
The text was updated successfully, but these errors were encountered: