how to tell gradle to download all the source jars

后端 未结 6 2052
暖寄归人
暖寄归人 2020-12-04 23:53

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?

<
6条回答
  •  一生所求
    2020-12-05 00:19

    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).

提交回复
热议问题