Ideally, we would like to add a task for downloading all the source jars for the first level and transitive dependencies of our project. Is there a way to do that?
<
If you use Eclipse and want to navigate the source code of your dependencies there, then the Eclipse plugin does this for you.
Install the eclipse plugin by adding apply plugin: "eclipse"
to your build.gradle file. Then run gradle eclipse
to generate the Eclipse .project, .classpath and .settings files. The plugin will download all available sources automatically and add references them in the .classpath file (see the sourcepath
attribute of the classpathentry
element).
To import the project into Eclipse, choose File > Import... > Existing Projects into Workspace
and select your project.
(I'm not sure whether the Idea plugin does the same for Idea users, but it may do).