Plugin cannot resolve class in Grails 2.2.4

Whenever I launch the Grails application for the first time, using 0.6.4 to search, I get the following error:

| Error Fatal error during compilation org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 25: unable to resolve class org.compass.gps.device.hibernate.HibernateGpsDevice @ line 25, column 1. import org.compass.gps.device.hibernate.HibernateGpsDevice ^ C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 26: unable to resolve class org.compass.gps.impl.SingleCompassGps @ line 26, column 1. import org.compass.gps.impl.SingleCompassGps ^ 2 errors (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.) org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 25: unable to resolve class org.compass.gps.device.hibernate.HibernateGpsDevice @ line 25, column 1. import org.compass.gps.device.hibernate.HibernateGpsDevice ^ C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 26: unable to resolve class org.compass.gps.impl.SingleCompassGps @ line 26, column 1. import org.compass.gps.impl.SingleCompassGps ^ 2 errors at RunApp$_run_closure3_closure8_closure9.doCall(RunApp:62) at RunApp$_run_closure3_closure8_closure9.doCall(RunApp) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at RunApp.withCompilationErrorHandling(RunApp:69) at RunApp.this$4$withCompilationErrorHandling(RunApp) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:168) at RunApp$_run_closure3_closure8.doCall(RunApp:61) at RunApp$_run_closure3_closure8.doCall(RunApp) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at RunApp$_run_closure3.doCall(RunApp:58) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90) at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.processClosure(GantMetaClass.java:81) at org.codehaus.gant.GantMetaClass.processArgument(GantMetaClass.java:95) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:128) at RunApp$_run_closure2.doCall(RunApp:45) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90) at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:168) at RunApp$_run_closure2_closure9.doCall(RunApp:42) at RunApp$_run_closure2_closure9.doCall(RunApp) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at RunApp$_run_closure2.doCall(RunApp:41) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90) at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.processClosure(GantMetaClass.java:81) at org.codehaus.gant.GantMetaClass.processArgument(GantMetaClass.java:95) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:128) at RunApp$_run_closure1.doCall(RunApp.groovy:30) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90) at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at gant.Gant.withBuildListeners(Gant.groovy:427) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:415) at gant.Gant.this$2$dispatch(Gant.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.executeTargets(Gant.groovy:591) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at gant.Gant.executeTargets(Gant.groovy:590) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) | Error Fatal error during compilation org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 25: unable to resolve class org.compass.gps.device.hibernate.HibernateGpsDevice @ line 25, column 1. import org.compass.gps.device.hibernate.HibernateGpsDevice ^ C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 26: unable to resolve class org.compass.gps.impl.SingleCompassGps @ line 26, column 1. import org.compass.gps.impl.SingleCompassGps ^ 2 errors 

Attempting to launch the application a second time leads to the launch of the application as expected.

Not a showstopper, but definitely troublesome, any idea on how to resolve this?

+4
source share
2 answers

Believe me, you need to run grails refresh-dependencies after adding the plugin to BuildConfig.groovy , but before the run-app .

This will help in updating the application dependencies to the two files that are present in the plugin lib .

searchable-0.6.4/lib/compass-2.2.1.jar .

Since these dependencies are not configured in the dependencies section of the BuildConfig plugin, but in lib , therefore, the refresh-dependencies command is required.

It works in subsequent attempts, because as soon as the application is compiled or launched, the application becomes aware of the transitive dependencies that it needs to extract from the plugin.

+5
source

I need to add a couple of maven repos to BuildConfig.groovy

 mavenRepo "http://repo.grails.org/grails/core" mavenRepo "https://oss.sonatype.org/content/repositories/releases/" 

And then:

 grails compile --non-interactive --refresh-dependencies 

Tested on grails 2.3.7

+8
source

Source: https://habr.com/ru/post/1495656/


All Articles