Intellij Groovy compiler - how to see logs?
已回答
I have a Gradle and Groovy project that compiles fine if I use the
Build, Execution, Deployment -> Build Tools -> Gradle -> Build and run using: Gradle
option, but fails on Groovy compilation if I switch to
Build and run using: Inteliij IDEA
However, the error isn't very useful and I want to get more logging from the groovy compiler that Intellij is using - how can I do this?
请先登录再写评论。
Hello, Jim!
Could you please upload a screenshot of the error message you are getting in IDEA's UI along with IDEA logs (Help -> Collect Logs and Diagnostic Data)?
Hi Roman!
please see below screenshot (as it's work-related I have redacted the project info, but the paths being mentioned in the error are identical).
The log dump is available here: https://drive.google.com/file/d/1qu0RtNHT3EhGOcEbLF9NJ93StOXSdiRB/view?usp=sharing
Jim,
Thank you for providing the information!
Is there a ValueOfEnum class defined in the ValueOfEnum.groovy file?
Hi Roman,
Yes there is - here's the file ( named ValueOfEnum.groovy ) below.
It should be noted that if I remove this class from the codebase, the groovy compiler shows the same error but for other files, so it sounds like a red herring...
Jim,
This looks like a quirk of Groovy's logic. It automatically creates a class for each .groovy file with name of that file and if there is a class with the same defined in the file this results in a duplicate.
Do other files that Groovy throws errors for also have such classes declared?
Hi Roman,
The other files also have classes declared that match the file, but so does every file in the project, and every Groovy project I've worked on has had the class names match the file names.
The Groovy compilation of the project works fine when run from the command line using the gradle wrapper (./gradlew clean assemble), it's just when running the compilation via IDEA that it fails…
Hi Roman,
I've managed to recreate this in a very simple project - see https://drive.google.com/file/d/1vKJhlZ0y09IVxT-AZEvLeag8jFC2zUMX/view?usp=sharing for the zip file.
Set settings as Build, Execution, Deployment -> Build Tools -> Gradle -> Build and run using: Intellij IDEA, and then Build → Rebuild Project to see the error I'm seeing.
Commenting out the annotation in the MyDto class resolves the compilation issue via IDEA - I've no idea why though…it appears to be Groovy 4 related?
I've raised a bug for this: https://youtrack.jetbrains.com/issue/IDEA-331174/Groovy-compilation-fails-for-annotated-field
Roman, have I set up this bug report correctly and in the correct place? There's been no activity on it for 3 weeks and the assignee hasn't acknowledged it - what's the SLA supposed to be on processing bug reports?
Hello, Jim Renwick. As I see, there are no problems with the bug report you created; the bug was reproduced on our side, and the issue awaits the responsible developer to take a look at it.
Hi Olga, thanks for confirming. What's the normal timeframe for bugs to be processed by?
Jim Renwick, unfortunately, we don't have any specific obligations for our developers to process the issues in a certain period of time. I asked the responsible developer to take a look at the bug you reported, and most likely, it will be updated in a week or so.
Ok thanks Olga, I'll wait and see..