How to download javadocs and sources for jar using Gradle 2.0?

后端 未结 4 1536
星月不相逢
星月不相逢 2020-11-30 01:46

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?

4条回答
  •  萌比男神i
    2020-11-30 02:22

    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
    

提交回复
热议问题