title: How to create ConfigObject using only nested maps in Grails?
body: <p>It is possible to implement closure-based config as a map of maps?</p>
  
  <pre><code>grails {
    acme {
       host = 'localhost'
       poolSettings {
          timeout = 5000
       }
    }
  }
  </code></pre>
  
  <p>The above config is convention for a grails plugin. We're doing a migration, and due to legacy constraints, we need to create the config dynamically to eliminate impact to legacy code. </p>
  
  <p>I started with a simple config:  </p>
  
  <pre><code>grails.acme = [host:'localhost']
  </code></pre>
  
  <p>This works fine with the plugin on startup, so I added a nested map:</p>
  
  <pre><code>grails.acme = [host:'localhost']
  def poolProps = //do some work to get pool settings
  grails.acme &lt;&lt; [poolSettings:poolProps]
  </code></pre>
  
  <p>On startup I pretty print <code>grails.acme</code>:</p>
  
  <pre><code>{
      "host": "locahost",
      "poolSettings": {
          "timeout": 5000
      }
  }
  </code></pre>
  
  <p>It looks normal, but soon after the acme plugin fails with the following error:</p>
  
  <blockquote>
    <p>2014-09-27 23:27:07,460 [localhost-startStop-1] ERROR
    context.GrailsContextLoader  - Error initializing the application: No
    signature of method: AcmePlugin$_closure2_closure5_closure9 .doCall()
    is applicable for argument types: (grails.spring.BeanBuilder) values:
    [grails.spring.BeanBuilder@7b067fd7] Possible solutions:
    doCall(java.lang.Object, java.lang.Object), call(),
    call([Ljava.lang.Object;), call(java.lang.Object),
    call(java.lang.Object, java.lang.Object), findAll() Message: No
    signature of method:
    AcmeGrailsPlugin$_closure2_closure5_closure9.doCall() is applicable
    for argument types: (grails.spring.BeanBuilder) values:
    [grails.spring.BeanBuilder@7b067 fd7] Possible solutions:
    doCall(java.lang.Object, java.lang.Object), call(),
    call([Ljava.lang.Object;), call(java.lang.Object),
    call(java.lang.Object, java.lang.Object)</p>
  </blockquote>
  
  <p>I'm sort of stumped on this, I'm assuming it's not possible, and I'm not sure how to even approach the closure-based convention dynamically.</p>