tags:

views:

29

answers:

2
+1  A: 

I have seen this before. My usual response to resolve this is to:

  1. Close / reopen the project.
  2. Confirm the project is converted to a groovy project
  3. Clean and rebuild the project.

If that doesn't work...You can try to create a new project with the existing source.

good luck!

Eric W
Tried the steps above. It didn't work. This sucks. lol. When I right click the file and run it, it works. I created a new groovy project, cut/paste the same code into the same file name under the same package, and it works perfectly without errors. My other project is maven/aspectj/groovy... I wonder if that combination confuses the editor, somehow.
gmale
+1  A: 

The AspectJ/Groovy combination is not working inside of Eclipse. They each require their own builder and they are not compatible with each other. The only way that this will work is if you separate your AspectJ and your Groovy code into different projects.

This combination may work in Maven since it can use different compilers for different source folders. However, there may be a circularity problem your aspect code depends on your groovy code (which in turn depends on your aspect code).

Andrew Eisenberg
arg! That's frustrating but it makes sense. Recently, I created a custom builder (that accomplishes everything through ant). I'd love to disable the Groovy builder and rely on our builder, alone but I don't see a groovy builder in the project's Builders list. Puzzlingly, when I disable all builders, I still get the red lines... even after closing/reopening the project... this doesn't make any sense. Who is responsible for those red lines, if not a builder?!
gmale
Right. There is no groovy builder since Groovy-Eclipse ships with a patch for the Java Builder so that it can compile both groovy and Java code.The red squiggles in the editor does not come from the builder, but rather from the reconciler. After every editor change, the reconciler is called, which performs an operation that is kind of like compilation, but only for the current file and no class files are produced. This is how you can get very detailed problem reporting in your Java and Groovy files even if you haven't saved them.
Andrew Eisenberg