Mixed Java and Groovy project cannot build

已回答

This is my sample project to reproduce.

https://github.com/kota65535/GroovyEclipseTest

The project contains the following classes:

  • Java class using Lombok annotated (@Builder) Java class
  • Java class using AST transformed (@Builder) Groovy class
  • Groovy class using Lombok annotated (@Builder) Java class 

I tried two Java compilers, Javac and Groovy-Eclipse. Here show the error messages I got.

 

Javac

Error:(7, 16) java: cannot find symbol
symbol: method builder()
location: class GroovyModel

 

Groovy-Eclipse (using groovy-eclipse-batch 2.5.7-01)

Error:(7, -1) Groovy-Eclipse: The method builder() is undefined for the type GroovyModel
Error:(9, -1) Groovy-Eclipse: The method builder() is undefined for the type JavaModel

 

To build mixed Groovy and Java project is difficult when it comes to AST transformation. I found a workaround to build with maven by configuring 2 phase compilation, ignoring the 1st compilation error (https://github.com/groovy/groovy-eclipse/issues/824).

I would be happy if IntelliJ has the kind of function like 2 phase compilation mode.

 

0

Thanks for the report, I've submitted https://youtrack.jetbrains.com/issue/IDEA-214609 that you can follow for updates. See https://intellij-support.jetbrains.com/hc/articles/207241135 if you are not familiar with YouTrack.

0

请先登录再写评论。