Skip to content

Error compiling class that implements trait (binary reference from grails-testing-support) #714

@AntonPanikov

Description

@AntonPanikov

I am using Grails framework (3.3.x and 3.2.x) and all grails applications is always producing some strange compile error, while application is always compile fine with gradle and internal eclipse compiler. So I can run an app as regular spring boot app and debug it. The issue is if I have some gradle sub-project then any project that depends on it will be not compiled at all by internal eclipse compiler, so will be not runnable and I can not debug it, while gradle still can compile and run it.

I am using:
Eclipse Oxygen.3a Release (4.7.3a)
Groovy-Eclipse 3.1.0.xx-201808241936-e47

You can easily create sample app with sdkman or use attached one below:

  1. Install sdkman:
    curl -s "https://get.sdkman.io" | bash
  2. Source or open new shell:
    source "$HOME/.sdkman/bin/sdkman-init.sh"
  3. Install grails:
    sdk i grails
  4. Create sample app in some folder (grails-example):
    grails create-app --profile web --inplace

Import it into eclipse and add gradle nature, you will get:

The project was not built since its build path is incomplete. Cannot find the class file for grails.testing.services.ServiceUnitTest$Trait$FieldHelper$1. Fix the build path then try building this project

Based on source you can get different variations of this error referencing different classes from grail, like:

The project was not built since its build path is incomplete. Cannot find the class file for grails.artefact.Controller$Trait$FieldHelper$1. Fix the build path then try building this project

While project is actually compile fine and running.
grails-sample.zip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions