如何导入groovyx.net.http [英] How to import groovyx.net.http

查看:174
本文介绍了如何导入groovyx.net.http的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白麦克风或葡萄,而我是一个白痴,所以如果你的答案是去追逐X依赖管理器,然后rtfm,然后设置,那么一步一步地给我。我在哪里可以找到并转储文件以使此行工作:

  import groovyx.net.http.HTTPBuilder 

它说 Groovy:无法解析类groovyx.net.http.HTTPBuilder



此外,我无法导入 groovyx.net.http.ContentType.URLENC 它说无法解析类groovyx.net.http.ContentType.URLENC



更新:



显然,您可以在BuildConfig.groovy

mavenRepohttp://repository.codehaus.org class =h2_lin>解决方案

由于您正在谈论BuildConfig.groovy,我假设问题的目标是在Grails应用程序中使用HttpBuilder。如果是这样,你可以使用

  compile('org.codehaus.groovy.modules.http-builder:http-builder: 0.5.0'){
不包括commons-logging,xml-apis,groovy
}

$在BuildConfig.groovy的依赖关系部分中,b
$ b

,或者更简单,只需安装休息插件

  grails install-plugin rest 


I don't understand maven or grape, and I'm an idiot so give me the step by step if your answer is "go grap X-dependency manager and then rtfm and you're set." Where do i find and dump files to make this line work:

import groovyx.net.http.HTTPBuilder

It says Groovy: unable to resolve class groovyx.net.http.HTTPBuilder

Also I am unable to import groovyx.net.http.ContentType.URLENC It says unable to resolve class groovyx.net.http.ContentType.URLENC

Update:

apparently you can uncomment the line mavenRepo "http://repository.codehaus.org" in BuildConfig.groovy

解决方案

Since you're talking about BuildConfig.groovy I assume the question is targeted at using HttpBuilder in a grails application. If so, you could either use

compile('org.codehaus.groovy.modules.http-builder:http-builder:0.5.0') {
        excludes "commons-logging", "xml-apis", "groovy"
}

in the dependencies-section of BuildConfig.groovy, or, even more easier, just install the rest plugin:

grails install-plugin rest

这篇关于如何导入groovyx.net.http的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆