Reputation: 415
Along with many class resolution errors, my project suddenly started to display this error on the package:
The type groovy.lang.MetaClass cannot be resolved. It is indirectly referenced from required .class files - The type groovy.lang.GroovyObject cannot be resolved. It is indirectly referenced from required .class files
I also noted that the unit tests all are failing to compile and display this error on the TestFor annotation:
- Groovy:class TestFor is not an annotation in @TestFor
- Groovy:unable to resolve class TestFor , unable to find class for
annotation
I have tried to clean the project then to refresh dependencies but still no joy. I quite STS and restarted and tried the clean/refresh as well.
I do get a compile error on one of my .groovy files which complain about undefined classes--but I have added the jar defining those classes to my lib folder and do not see any errors on import of the class.
Any suggestions? Do I have to rebuild the entire project?
Upvotes: 1
Views: 3801
Reputation: 415
It turns out that an undefined symbol that stopped the compile had this result. I wasn't familiar with how STS/Eclipse handles a failure to resolve a class and had expected the class path to have been defined before any actual compiles were completed.
So the answer is to look in the error log for STS, determine if one of my classes are missing, and resolve that first before rabbit-holing down a path like this.
Upvotes: 1