-
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
Parrot parser not used with maven-compiler-plugin when configured as documented #1107
Comments
I'll definitely need some clarification on your use case. Parrot Parser is disabled by default in Eclipse IDE and this has been stated in the release notes for every release that includes the new parser. The Maven batch compiler was not released until Groovy 3 was released and the compiler artifact was designed and tested to use the Parrot Parser. Since live editing is not involved, there was no reason to disable the new parser. If you are not using Eclipse IDE or Maven builds, what is your situation where the new parser is expected but is not appearing to be used? |
Am using it as documented on this site, but try-with-resource does NOT compile (on CLI, using |
So here is an example project Is basic archetype + groovy compiler
I get error
but, when I do Am I doing something wrong? |
And setting it for "real" (the thing I mention on OP) is quite cumbersome, as setting a system property from POM alone is not possible, unless you get an extra plugin, and use that. Why not just plain compiler argument instead (that maven-compiler-plugin already supports)? Also, why this (IMO wrong) default when used from Maven? |
If you want to enable with no system property, you can use
I am re-checking the maven integration. It was supposed to work with no additional config, but has clearly failed. |
Thanks @eric-milles |
The long term goal is to support recovery for the new parser and at that point there will be no reason to disable it by default. |
I am commenting here instead of in my duplicate #1137, in order to return something to the helpful community and hopefully for the benefit of others stumbling upon this problem too. Here is how I configure my IDE IntelliJ IDEA to use I do agree with @cstamas though: It should be a compiler option I can set directly in my Maven POM via Maven Compiler plugin. |
@cstamas Could you explain how you've used the |
Howdy, of course:
|
Perfect, thanks so much! |
A couple notes that might be useful:
|
Thanks for the Maven Compiler fork setting. It works nicely for me. So now in IntelliJ IDEA I no longer need to set the property in the Maven runner VM settings as described in #1107 (comment). For the Groovy-Eclipse compiler, I still need the property, though. I do not want to use a compiler config script, because that would be even more complicated and just be another extra IDE setting I need, i.e. nothing would improve that way with regard to my goal "simply import the Maven project and it works". @eric-milles, I created IDEA-270925 in order to track this problem and get it fixed in IntelliJ IDEA. On a side note: Setting the property in a |
I also ran into this problem and only found this issue after a lot of searching. I think it would make sense to just update the wiki's example POM or at least add a comment there. It's an easy fix once someone knows that the problem is that they need to enable the antlr4 parser, but as it stands you have to dig through the issues or old release notes to find it. |
Actually, I am not sure why the idea from the last paragraph of my previous comment #1107 (comment) was not implemented yet. It would be simple and fix the problem in several use cases. |
@cstamas @mattventura I updated the docs to make specific mention of the fork setting: https://github.com/groovy/groovy-eclipse/wiki/Groovy-Eclipse-Maven-plugin#how-to-use-the-compiler-plugin---setting-up-the-pom @kriegaex The design of this was to respect the system properties of a shared jvm. When forking the compiler process, it is safe enough to set the system property that enables antlr4 parser. It was unanticipated that IntelliJ uses a different entry point. The long-term goal is still to improve parser error recovery and then enable it by default -- as |
So if a the doco is followed to set up your Maven, the Parrot parser seems not used, see #1082
I believe this is worth documenting, as it causes HUGE discrepancy between what user reads on Groovy3 and whar Maven "eats" when configured as documented. Moreover, IDEs like Idea, when setup like this, does NOT behave as this (follows Groovy doco, does not need this system property to enable parrot parser).
Hence, this should be documented, on a very visible place. Plus: doco should get into detail how to setup maven compiler plugin to get "real" Groovy 3 as well.
The text was updated successfully, but these errors were encountered: