Q:

could not resolve all dependencies for configuration ':compile'

To study Gradle I am using the book Gradle in action. 
There was an example of dependency definition.
dependencies {
      compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1'
} 

But when I do in console gradle build I've got an error

What is the problem? My whole .gradle file looks like this
apply plugin: 'java'

dependencies {
     compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1'
}

A:

You did not tell Gradle where to find commons-lang3 library. Easy fix is to add the following to your build script:
repositories {
    mavenCentral()
}

Of course you can find this piece of information in documentation - http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html#N10608

