【发布时间】:2016-12-25 14:58:49
【问题描述】:
我明白了
解决获取依赖项的错误:在 grailsCentral (https://repo.grails.org/grails/plugins) 中找不到工件 org.grails.plugins:rest-client-builder:jar:2.1.1(使用 --stacktrace 查看完整跟踪)
有了这个 BuildConfig.groovy:
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
mavenRepo "http://repo.spring.io/milestone"
mavenRepo "http://repo1.maven.org/maven2/"
mavenRepo "http://repo.grails.org/grails/core"
mavenRepo "http://repo.grails.org/grails/plugins"
}
dependencies {
test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"
compile 'commons-beanutils:commons-beanutils:1.8.3'
runtime 'mysql:mysql-connector-java:5.1.34'
compile 'com.maxmind.geoip2:geoip2:2.7.0'
compile 'org.apache.httpcomponents:httpclient:4.5.2'
compile "org.grails.plugins:rest-client-builder:2.1.1"
}
我尝试了通常的方法:
grails clean
grails refresh-depenencies
但没有运气。很多人都遇到过同样的问题,但不幸的是,他们的“修复”都没有奏效。
【问题讨论】:
-
它应该被声明为
pluginsdsl下的grails插件依赖项plugins { compile ':rest-client-builder:2.1.1' }。 -
是的,就是这样!文档是错误的,它说把它放在依赖项中,而不是插件中。现在工作!
-
在哪里?纠正它。
-
BuildConfig.groovy 中有我的 mavenRepo。尝试将其添加到存储库中
mavenRepo "http://repo.grails.org/grails/repo/" -
解决方案有效吗?