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?
To do this in Gradle, we must add the option to the javadoc task configuration. We use the addBooleanOption method of the options property that is part of the javadoc task. We set the argument to html5 and the value to true .
To download sources for dependencies of maven project, right click on project → Maven → Download Sources . Similarly to download JavaDoc for dependencies of maven project, right click on project → Maven → Download JavaDoc .
Gradle will only download JDK versions for GA releases. There is no support for downloading early access versions.
I guess your question is related to a dev workspace, here are links explaining how to add the required configuration in Gradle using the IDEs' plugins:
For Eclipse:
apply plugin: 'java' apply plugin: 'eclipse' eclipse { classpath { downloadJavadoc = true downloadSources = true } }
For IntelliJ & Android Studio
apply plugin: 'java' apply plugin: 'idea' idea { module { downloadJavadoc = true downloadSources = true } }
To run these plugins:
gradle cleanEclipse eclipse gradle cleanIdea idea
In addition to previous question, here is Gradle Kotlin DSL version:
plugins { id("idea") } idea { module { isDownloadJavadoc = true isDownloadSources = true } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With