I am using Gradle 2.0. What should I write in build.gradle so that the javadocs and sources are also downloaded along with the jars?
build.gradle
You can write an ArtifactResolutionQuery that copies all SourcesArtifact and JavadocArtifact for each of your dependencies
See here for an example and here for the gradle source code which does it for the Eclipse/Intellij plugins