Grails2.5.5无法安装插件:rest客户端生成器:jar:2.1.1

Grails2.5.5无法安装插件:rest客户端生成器:jar:2.1.1,grails,plugins,Grails,Plugins,我明白了 解决获取依赖项时出现的错误:在grailsCentral()中找不到工件org.grails.plugins:rest客户端生成器:jar:2.1.1(使用--stacktrace查看完整跟踪) 使用此BuildConfig.groovy: repositories { inherits true // Whether to inherit repository definitions from plugins grailsPlugins() grailsHo

我明白了

解决获取依赖项时出现的错误:在grailsCentral()中找不到工件org.grails.plugins:rest客户端生成器: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

但是没有运气。很多人都遇到过同样的问题,但不幸的是,他们的“修复”没有一个奏效。

解决方案由dmahapatro提供,将定义移到插件中:

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"
}

plugins { 
    build ":tomcat:8.0.20"
    :
    compile "org.grails.plugins:rest-client-builder:2.1.1"
}

它应该在
plugins
dsl的
plugins{compile':restclientbuilder:2.1.1'}
下声明为grails插件依赖项。是的,就是这样!文档是错误的,它说把它放在依赖项中,而不是插件中。现在工作!哪里在BuildConfig.groovy中有我的mavenRepo。尝试将此添加到存储库
mavenRepo”http://repo.grails.org/grails/repo/“
解决方案有效吗?