RestClient Grails 导入失败 [英] RestClient Grails Import fails
问题描述
我无法在我的 grails 项目中导入 RESTClient
.消息是:
I can't import the RESTClient
in my grails project. The message is:
Groovy:unable to resolve class groovyx.net.http.RESTClient
在 BuildConfig.groovy
中我取消注释:
mavenRepo "http://repository.codehaus.org"
并添加:
compile ":rest-client-builder:2.0.0"
我使用的是 grails 2.3.8 和 Windows 7.
I'm using grails 2.3.8 and Windows 7.
有什么想法吗?grails install-plugin 在这个 grails 版本中不起作用.
Any ideas? The grails install-plugin does not work in this grails version.
推荐答案
rest-client-builder
插件没有提供名为 groovyx.net.http.RESTClient
的类代码>.我认为您对 Groovy 的 REST 客户端模块感到困惑:
The rest-client-builder
plugin doesn't provide a class called groovyx.net.http.RESTClient
. I think you are getting confused with Groovy's REST client module:
http://groovy.codehaus.org/modules/http-builder/doc/rest.html
不过,我们不建议在 Grails 应用程序中使用上述模块,使用 rest-client-builder
插件会更好,您只需要使用正确的 API.
The above module is not however recommended for us inside Grails applications and you are far better off with the rest-client-builder
plugin, you just need to use the right API.
rest-client-builder
的文档在
https://github.com/grails-plugins/grails-rest-client-builder/
和
http://grails.github.io/grails-data-mapping/rest-client/api/index.html
这篇关于RestClient Grails 导入失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!