Gradle: What is the difference between classpath and compile dependencies?

后端 未结 3 621
逝去的感伤
逝去的感伤 2021-01-30 12:11

When adding dependencies to my project I am never sure what prefix I should give them, e.g. \"classpath\" or \"compile\".

For example, should

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-30 13:01

    I'm going to guess that you're referencing compile and classpath within the dependencies {} block. If that is so, those are dependency Configurations.

    A configuration is simply a named set of dependencies.

    The compile configuration is created by the Java plugin. The classpath configuration is commonly seen in the buildSrc {} block where one needs to declare dependencies for the build.gradle, itself (for plugins, perhaps).

提交回复
热议问题