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

Install rest-client-builder 2.1.1 in grails 2.4.3 manually

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

我将其复制到该地址的 .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$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$withBuildListeners(Gant.groovy)
    at gant.Gant$this$withBuildListeners[=10=].callCurrent(Unknown Source)
    at gant.Gant.dispatch(Gant.groovy:415)
    at gant.Gant.this$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

¿有什么帮助吗? 提前致谢

好吧,对我来说它奏效了:

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

    grails 添加代理客户端“--host=http://localhost/”“--port=3128”

(3128为cntlm默认端口)

  1. 在 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"
    }