Intellij Groovy compiler - how to see logs?

Answered

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?

0
13 comments

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)?

0

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 

0

Jim,

Thank you for providing the information!

Is there a ValueOfEnum class defined in the ValueOfEnum.groovy file?

0

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...

package com.example

import jakarta.validation.Constraint

import java.lang.annotation.Documented
import java.lang.annotation.Retention
import java.lang.annotation.Target

import static java.lang.annotation.ElementType.ANNOTATION_TYPE
import static java.lang.annotation.ElementType.CONSTRUCTOR
import static java.lang.annotation.ElementType.FIELD
import static java.lang.annotation.ElementType.METHOD
import static java.lang.annotation.ElementType.PARAMETER
import static java.lang.annotation.ElementType.TYPE_USE
import static java.lang.annotation.RetentionPolicy.RUNTIME

@Target([METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE])
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = ValueOfEnumValidator)
@interface ValueOfEnum {

Class<? extends Enum<?>> value()
String message() default "must be an enum of class {value}"

}
0

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?

0

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…

0

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?

0

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?

0

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. 

0

Hi Olga, thanks for confirming.  What's the normal timeframe for bugs to be processed by?

0

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. 

0

Ok thanks Olga, I'll wait and see..

0

Please sign in to leave a comment.