I am trying to build a Grails project in STS and am getting many error messages of the form: Groovy:unable to resolve class org.codehaus.groovy.grails.commons.ConfigurationHolder
as well as others like Groovy:unable to resolve class org.grails.plugins.springsecurity.service.AuthenticateService
. I have Grails 1.3.7 selected in the Project Properties, but I don't see an item for 'Grails Depedencies' like I do when I create a sample project. Is this the problem? How can I add it back in?
I don't know why, but here are the steps I took to solve the problem:
For anyone who is using Grails >= 2.4
If you are using Grails 2.4 and above, use grails.util.Holders
instead of org.codehaus.groovy.grails.commons.ConfigurationHolder
.
Read the doc here section 'Static Holder'
Classes The following deprecated classes have been removed from Grails 2.4.x:
org.codehaus.groovy.grails.commons.ApplicationHolder org.codehaus.groovy.grails.commons.ConfigurationHolder org.codehaus.groovy.grails.plugins.PluginManagerHolder org.codehaus.groovy.grails.web.context.ServletContextHolder org.codehaus.groovy.grails.compiler.support.GrailsResourceLoaderHolder If you or any plugins you have installed are using these classes you will get a compilation error. The problem can be rectified by updating to new plugins and using grails.util.Holders instead.
If "Refresh Dependencies" has done all it can for you (as you indicate in your comment on the question), try disabling and re-enabling dependencies. You might try refreshing dependencies again afterward if the Acegi plugin still isn't recognized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With