【发布时间】:2015-01-12 16:33:18
【问题描述】:
我的 grails 2.3.6 应用程序有一个奇怪的行为。
我想使用 groovyx.net.http.HTTPBuilder 但 IDE 报告它无法解析该类。
所以,我在 BuildConfig.groovy 中添加了以下行:
build "org.codehaus.groovy.modules.http-builder:http-builder:0.7"
但我得到以下异常:
$ grails run-app MyApp
| Configuring classpath
| Error Resolve error obtaining dependencies: Could not find artifact org.codehaus.groovy.modules.http-builder:http-builder:zip:0.7 in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
| Error Could not find artifact org.codehaus.groovy.modules.http-builder:http-builder:zip:0.7 in grailsCentral (http://repo.grails.org/grails/plugins)
| Run 'grails dependency-report' for further information.
我在 BuildConfig.groovy 中的存储库:
mavenRepo "http://repository.codehaus.org"
mavenRepo "http://download.java.net/maven/2/"
mavenRepo "http://repo.spring.io/milestone/"
mavenRepo "http://www.hibernatespatial.org/repository"
mavenRepo "https://oss.sonatype.org/content/groups/public/"
mavenRepo "http://repo.grails.org/grails/core"
奇怪的是它应该在那里:http://repo.grails.org/grails/webapp/search/artifact/?1&q=http-builder
有什么想法吗?我清理了,删除了~/.m2,~/.groovy,~/.grails
谢谢!
【问题讨论】:
-
很奇怪。它对我有用。我使用
runtime('org.codehaus.groovy.modules.http-builder:http-builder:0.7.1')作为依赖项。 -
别人下载的,所以不是代理?这是通过 maven 还是 ivy?
-
0.7 在这里工作。你把它放在
plugins而不是dependencies吗?
标签: grails httpbuilder