Eclipse Gradle adding a classpath entry
<p>I'm adding a classpath entry to the .classpath file in Eclipse to avoid having to add it manually each time I run the .eclipse task while I add a number of dependencies. I need some resources on the path to run locally.</p>

<p></p>

<p>this works,</p>

<pre><code>eclipse.classpath.file {
   withXml { 
     def node = it.asNode()
     node.appendNode('classpathentry', 
                [kind: 'lib', path: '/some/path'])
           }
}
</code></pre>

<p>this doesn't,</p>

<pre><code>eclipse.classpath.file {
   whenMerged { classpath -&gt;
      classpath.entries.add { entry -&gt; kind: 'lib', path: '/some/path' }
              }
}
</code></pre>

<p>The error I get is, </p>

<p>startup failed: build.gradle': 75: unexpected token: lib @ line 75, column 48.
.entries.add { entry -> kind: 'lib', pat
                              ^</p>

<p>For future reference, what is wrong with the second example?</p>