I have a Grails project that I created using Groovy/Grails Tool Suite version 3.0.0M3 running on Windows 7 with JDK 1.7. The Grails version is 2.0.4.
There is a unit test class that was running fine until I refactored the class under test by changing method names and by adding new methods. The class under test resides in a package under src/java. The unit test class was updated to reflect the refactoring changes, but now when grails test-app is executed, the unit test reports compilation errors stating that it “cannot find symbol” All of these errors pertain to either the renamed methods or the new methods that I added. Note that the Tool Suite does not display any error markers within the project explorer pane.
I have run grails clean both from the command line and from within the Tool Suite, as well as the Tool Suite project->clean command. My BuildConfig.groovy has the correct directory set for grails.project.class.dir, and I verified that the class file within that location is being updated after a compile. Here is one of the error messages that is reported
XMLUtilTest.java:73: error: cannot find symbol
Package pkg = u.unmarshalPackage(packageRefXml); ^symbol: method unmarshalPackage(String)
location: variable u of type XMLUtil
Try the following:
My guess is that grails inside of STS is using some of the old classes. The Eclipse project will use
target-eclipse/classesfor its output folder, but Grails by default will usetarget/classesfor its output folder.I’d do a grep on the command line inside of your project for files called
XMLUtil*.classand you might find where the duplicates lie.