Search code examples
grailsgrails-plugin

Install rest-client-builder 2.1.1 in grails 2.4.3 manually


I need install rest-client-builder 2.1.1 in grails 2.4.3 but my internet access is very limited and behind a proxy. I download from https://repo.grails.org the entire folder of plugin, the files are:

  • 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

I copy that to my .m2 folder in that address: .m2/repository/org/grails/plugins/rest-client-builder/2.1.1 But when i run : grails install-plugin rest-client-builder 2.1.1, I have the following error: Error installing plugin: grails.org (Use --stacktrace to see the full trace)

This is the full trace (with --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

¿Any help? Thanks in advance


Solution

  • Well, for me it worked:

    1. Install cntlm and configure settings of my proxy
    2. Run in a terminal:

      grails add-proxy client "--host=http://localhost/" "--port=3128"

    (3128 is the defaul port of cntlm)

    1. Add this config on 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"
      }