title: Adding jars to classpath using gradle
body: <p>In gradle, is there a way to reference external jars. I have some external jars, sitting in another folder outside the project structure. Is there a way to add a reference to these jars in my build.gradle file, so that they are picked up during the compilation process?</p>
  
  <p>Thanks</p>
  
  <p>Edit:</p>
  
  <p>I modified mu build.gradle with an allprojects task having the following 'sub-tasks(?)' as follows:</p>
  
  <pre class="lang-groovy prettyprint-override"><code>repositories{
     flatDir name:'ExternalJars',dirs:'&lt;path to the jars&gt;'
     dependencies{
        compile: 'jarname:jarname:version'
     }
  }
  </code></pre>
  
  <p>This seems to make my build run just fine. Can someone shed some light on what exactly is happenning when I create the repository and specify the dependencies? - Thanks</p>