title: How to put local dependencies first when calling gradle idea?
body: <p>When calling <code>gradle idea</code>, external dependencies are ordered first in the class path relatively to local Jar inclusions. As such :</p>
  
  <pre><code>dependencies {
      compile fileTree(dir: 'libs', include:['*.jar'])
      compile group: 'foo', name:'bar', version:'1.0.0'
  }
  </code></pre>
  
  <p>will include my local jars last. This is a problem in my project as these jars' purpose is to partially overwrite the external library.</p>
  
  <p>The same behavior is observed when specifying the repository as a source of dependencies using <code>flatDir</code> and loading the jar without <code>fileTree</code>. It is put last in the classpath. </p>
  
  <p>I have found several mentions of the problem when researching, such as <a href="https://discuss.gradle.org/t/gradle-messes-up-the-classpath-order-in-generated-projects-when-there-are-mixed-dependency-types/13130" rel="nofollow noreferrer">https://discuss.gradle.org/t/gradle-messes-up-the-classpath-order-in-generated-projects-when-there-are-mixed-dependency-types/13130</a>, but no workarounds.</p>
  
  <p>I suppose these exist, gradle being very customisable, but being very new to it my attempts to make one fail.  How to proceed?</p>