title: Fail the Gradle build when dependencies are not available
body: <p><code>build.gradle</code> (unnecessary parts were ommited):</p>
  
  <pre><code>apply plugin: 'java'
  
  repositories {
      mavenCentral()
      maven {
          credentials {
              username "$mavenUser"
              password "$mavenPassword"
          }
          url "http://localhost:8081/nexus/content/groups/public"
      }
  }
  
  dependencies {
      compile("com.example:some-lib:1.0.0-RELEASE")
  }
  </code></pre>
  
  <p>Assume that the defined dependency is missing in configured Maven repository. When <code>./gradlew clean build</code> tasks are executed the application is built successfully, although the required dependencies are missing.</p>
  
  <p><strong>Is there a way to configure Gradle to fail if there are unresolved dependencies?</strong></p>
  
  <hr>
  
  <p>Relates to:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/42527631/how-to-make-gradle-fail-the-build-if-a-file-dependency-is-not-found">How to make Gradle fail the build if a file dependency is not found?</a> - Solution provided there is not applicable.</li>
  </ul>