Automatically download sources of dependencies with gradle

I want to download automatically sources of dependencies with gradle. I found as solution a code snippet to put in the build.gradle file

idea {
 module{ 
            downloadSources = true 
       }
}

but it does not work. When I reimport the Gradle project or build my project, the sources are not imported. I have to download the sources manually by using the "Download Sources" button in the editor.

Currently I am using Gradle 5.2.1 with Amazon Corretto 1.8.232 and IntelliJ IDEA CE 2019.3.1.

I would be very grateful for any hint to solve my problem.

7

The piece of configuration you left is for 'idea' Gradle plugin:

plugins {
...
id 'idea'
}

Also, I would add that you can download not only sources but a JavaDoc as well:

idea {
module {
downloadJavadoc = true
downloadSources = true
}
}

 

1

Does it support gralde v8 ? 

0

请先登录再写评论。