RestClient Grails Import fails

ⅰ亾dé卋堺 提交于 2020-01-21 10:33:19

问题


I can't import the RESTClient in my grails project. The message is:

Groovy:unable to resolve class groovyx.net.http.RESTClient

In the BuildConfig.groovy I uncommented:

mavenRepo "http://repository.codehaus.org"

and added:

compile ":rest-client-builder:2.0.0"

I'm using grails 2.3.8 and Windows 7.

Any ideas? The grails install-plugin does not work in this grails version.


回答1:


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

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.

The docs for rest-client-builder are at

https://github.com/grails-plugins/grails-rest-client-builder/

and

http://grails.github.io/grails-data-mapping/rest-client/api/index.html



来源:https://stackoverflow.com/questions/24353035/restclient-grails-import-fails

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!