I'm trying to implement in my project the "Apple Push Notification Service Integration" plugin grails (http://grails.org/plugin/apns), but I'm getting an error that seems that use a deprecated method in grails.
My questions is; is some different way to can use this plugin? or How can I fix this?
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
.Error
|
Fatal error during compilation org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
C:\Users\Documents\worspace\example\target\work\plugins\apns-1.0\.\ApnsGrailsPlugin.groovy: 1: unable to resolve class org.codehaus.groovy.grails.commons.ConfigurationHolder
@ line 1, column 1.
import org.codehaus.groovy.grails.commons.ConfigurationHolder
^
1 error
(Use --stacktrace to see the full trace)
ConfigurationHolder
and a few other static holder classes were deprecated and eventually removed, so you'll see errors like this when trying to use older plugins that use the holder classes and haven't been updated. The source repo had a newer version of the code that didn't use holder classes but it was still somewhat dated so I cleaned it up and sent a pull request.
I don't know if or when the author might do a new release of the plugin but you could build the plugin from my repo for testing, or since the plugin is so simple you could inline it into your application.
The plugin only provides the apnsService
Spring bean and the jar dependencies that it needs, so the other option is to include ApnsFactoryBean.groovy
into your application, copy the code in the doWithSpring
block in ApnsGrailsPlugin
to your app's grails-app/conf/spring/resources.groovy
, and copy the three dependencies from BuildConfig.groovy
(apns, mina-core, and jackson-mapper-asl, but not the release or rest-client-builder plugins) to your app's BuildConfig.groovy
. Configuration would be the same as described in the plugin docs.
If you copy the code to your app be sure to follow the requirements defined by the plugin's use of the GPL3 license.