简体   繁体   English

在Grails中安装APNS插件的MultipleCompilationErrorsException

[英]MultipleCompilationErrorsException installing apns plugin in grails

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. 我正在尝试在我的项目中实施“ Apple Push Notification Service集成”插件grails( http://grails.org/plugin/apns ),但出现一个错误,似乎在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. 不推荐使用ConfigurationHolder和其他一些静态持有人类,并最终将其删除,因此,当您尝试使用使用持有人类但尚未更新的旧插件时,会看到类似的错误。 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 . 该插件只提供apnsService的Spring bean,它需要依赖的JAR,所以另一种选择是包括ApnsFactoryBean.groovy到你的应用程序中,将代码复制doWithSpringApnsGrailsPlugin到应用的grails-app/conf/spring/resources.groovy ,并将BuildConfig.groovy的三个依赖项(apns,mina-core和jackson-mapper-asl,而不是release或rest-client-builder插件)复制到应用程序的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. 如果将代码复制到您的应用中,请确保遵循插件使用GPL3许可证所定义的要求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM