【问题标题】:grails 2.5.5 cant install plugins:rest-client-builder:jar:2.1.1grails 2.5.5 无法安装插件:rest-client-builder:jar:2.1.1
【发布时间】: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/"
  • 解决方案有效吗?

标签: grails plugins


【解决方案1】:

解决方案由 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"
}

【讨论】:

    猜你喜欢
    • 2016-05-22
    • 2011-10-12
    • 2015-04-27
    • 2014-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-13
    相关资源
    最近更新 更多