我尝试在我的 groovy 类中导入 groovyx.net.http.RESTClient 。
我的常规课程是这样的:
void getREST() {
def r = new RESTClient(url)
def response = r.get(path:'test',headers:['Authorization': "auth"] )
println "RESPONSE"
println response.headers
response.headers.each { it ->
println it
}
}
在我的课堂上,我像这样导入 RESTClient:
import groovyx.net.http.RESTClient
但是,我收到“无法解析类 groovyx.net.http.RESTClient”错误。我使用的是 NetBeans IDE 7.4。
我已经使用以下代码配置了 BuildConfig.groovy:
compile ":rest:0.8"
并添加 Maven 存储库:
mavenRepo "http://repository.codehaus.org/"
但我仍然无法导入 RESTClient。我该怎么办?
修理它。只需在 BuildConfig 中再添加一个存储库即可:
mavenRepo "http://grails.org/plugins"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)