title: How to make Gradle fail the build if a file dependency is not found?
body: <p>I have a Gradle build that has some dependencies of the form</p>
  
  <pre><code>compile files('path/to/local/lib.jar')
  </code></pre>
  
  <p>(the build is being migrated - eventually these will be replaced)</p>
  
  <p>The build failed because one of these paths was incorrectly specified. But it failed due to a compile error - it looked like Gradle silently ignored the missing dependency.</p>
  
  <p>Is there a simple option or switch that will force Gradle to fail the build if any dependency (particularly local file dependencies) cannot be resolved (eg., file missing)?</p>
  
  <p>Edit: to clarify further:</p>
  
  <p>If a dependency cannot be found in the configured repositories, Gradle will fail the build when attempting to resolve them, as expected.</p>
  
  <p>BUT - if a dependency is defined as "compile files ....", and the file specified does not exist at build time, Gradle will IGNORE that error, and attempt compilation anyway. That seems <strong>spectacularly</strong> wrong-headed and inconsistent default behaviour. </p>
  
  <p>My question is - is there a Gradle option or switch or environment variable or system property that I can set to force Gradle to verify that file dependencies exist?  (E.g,, behave in a sane and rational way?)</p>