grails - 在grails 2.4.3中手动安装rest-client-builder 2.1.1

标签 grails grails-plugin

我需要在grails 2.4.3中安装rest-client-builder 2.1.1,但是我的Internet访问非常有限并且位于代理之后。我从https://repo.grails.org下载了整个插件文件夹,文件为:

  • rest-client-builder-2.1.1-plugin.xml
  • rest-client-builder-2.1.1-plugin.xml.md5
  • rest-client-builder-2.1.1-plugin.xml.sha1
  • rest-client-builder-2.1.1.pom rest-client-builder-2.1.1.pom.md5
  • rest-client-builder-2.1.1.pom.sha1 rest-client-builder-2.1.1.zip
  • rest-client-builder-2.1.1.zip.md5 rest-client-builder-2.1.1.zip.sha1

  • 我将其复制到该地址的.m2文件夹中:
    .m2 / repository / org / grails / plugins / rest-client-builder / 2.1.1
    但是当我运行:grails install-plugin rest-client-builder 2.1.1时,出现以下错误:
    安装插件时出错:grails.org(使用--stacktrace查看完整跟踪)

    这是完整的跟踪(使用--stacktrace)
    Error installing plugin: grails.org (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
    java.net.UnknownHostException: grails.org
        at InstallPlugin$_run_closure1.doCall(InstallPlugin.groovy:70)
        at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
        at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
        at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
        at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
        at gant.Gant.withBuildListeners(Gant.groovy:427)
        at gant.Gant.this$2$withBuildListeners(Gant.groovy)
        at gant.Gant$this$2$withBuildListeners$0.callCurrent(Unknown Source)
        at gant.Gant.dispatch(Gant.groovy:415)
        at gant.Gant.this$2$dispatch(Gant.groovy)
        at gant.Gant.invokeMethod(Gant.groovy)
        at gant.Gant.executeTargets(Gant.groovy:591)
        at gant.Gant.executeTargets(Gant.groovy:590)
    | Error Error installing plugin: grails.org
    

    ¿有帮助吗?
    提前致谢

    最佳答案

    好吧,对我来说,它起作用了:

  • 安装cntlm并配置我的代理
  • 的设置
  • 在终端中运行:

    grails add-proxy客户端“--host = http://localhost/”“--port = 3128”

  • (3128是cntlm的默认端口)
  • 在BuildConfig.groovy上添加此配置
    repositories {
    ...
    mavenRepo "http://repo.grails.org/grails/plugins" 
    mavenRepo "http://repo1.maven.org/maven2" 
    }
    
    plugins {
    ...
    //REST plugin
            compile ":rest-client-builder:2.1.1"
    }
    
  • 关于grails - 在grails 2.4.3中手动安装rest-client-builder 2.1.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35344349/

    相关文章:

    grails - 命令行中的Grails自定义标志

    grails - 如何使用Grails WebXmlConfig插件将属性添加到WEB.XML文件?

    grails - Grails:管理静态数据

    mongodb - Grails Mongo GORM 插件 - float 和字节的映射是字符串而不是数字

    rest - Grails REST 客户端插件 - PUT 正文内容

    spring - 如何正确获取 src/groovy 中的 'messageSource'?

    unit-testing - grails spock测试模拟CommonsMultipartFile

    javascript - Grails和Jasper-将创建 View 中的输入字段值作为参数发送到报表

    Grails 中数据库迁移插件的 Hibernate 问题

    grails - Grails-在重定向参数中发送对象列表