How to debug grails run-app loop

I recently had a problem where grails run-app would start the server, then immediately recompile 1 class, then restart… and repeat.

Google told me that the problem probably was an empty Java file in my project and to look in the ~/.grails/1.2-M4/projects/myproject/classes directory to see which file kept changing timestamp.

However, no files did that. The solution was to modify $GRAILS_HOME/scripts/_GrailsCompile.groovy and add listFiles:true to the compile target:

ant.groovyc(destdir:classesDirPath,
    classpathref:classpathId,
    encoding:"UTF-8",
    listFiles:true,
    compilerPaths.curry(classpathId, false))

And it turned out Google was right, I had a Java file with only the package specification in it.

Comments are closed.