Search code examples
eclipsegrailsgroovy

Grails 2.5.5 in Eclipse with Groovy Compiler 2.4.12 throws Refresh Dependencies error


I have installed Grails 2.5.5 in Eclipse GGTS (3.6.4.RELEASE) and have added Groovy Compiler feature 2.4.12. I am importing existing projects into the workspace.

Before updating the compiler, refresh dependencies (on a new project) worked without problems. Now, when I run Refresh Dependencies (alt+g,r), it throws an error. I am looking for guidance to help resolve the issue. The log shows the following

!ENTRY org.grails.ide.eclipse.core 4 0 2017-07-25 18:43:19.426
!MESSAGE Refresh dependecies failed
!STACK 0
java.lang.NoClassDefFoundError: org/codehaus/groovy/frameworkadapter/util/SpecifiedVersion
at org.grails.ide.eclipse.commands.GroovyCompilerVersionCheck.getRequiredGroovyVersion(GroovyCompilerVersionCheck.java:63)
at org.grails.ide.eclipse.commands.GroovyCompilerVersionCheck.getRequiredGroovyVersion(GroovyCompilerVersionCheck.java:57)
at org.grails.ide.eclipse.commands.GroovyCompilerVersionCheck.check(GroovyCompilerVersionCheck.java:50)
at org.grails.ide.eclipse.commands.GrailsCommandUtils.refreshDependencies(GrailsCommandUtils.java:327)
at org.grails.ide.eclipse.core.internal.classpath.GrailsClasspathContainerUpdateJob.runInWorkspace(GrailsClasspathContainerUpdateJob.java:89)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Solution

  • Background

    This is an issue present in a specific version of the groovy-eclipse plugin. As far as I know the issue is present in groovy-eclipse v2.9.2.xx-201707260047-e44 (groovy compiler v2.4.12).

    Since then the issue has ben reported and fixed.

    Solution

    To solve the problem simply update the groovy-eclipse plugin to v2.9.2.xx-201707311844-e44 or newer:

    • In the Help menu select Install New Software
    • Select or add the source http://dist.springsource.org/snapshot/GRECLIPSE/e4.4/ in the Work with field
    • In the Groovy Compilers category select the Groovy Compiler 2.4 item
    • Clic Next and proceed with the update
    • Restart GGTS to apply the changes