• <i id='MfcUi'><tr id='MfcUi'><dt id='MfcUi'><q id='MfcUi'><span id='MfcUi'><b id='MfcUi'><form id='MfcUi'><ins id='MfcUi'></ins><ul id='MfcUi'></ul><sub id='MfcUi'></sub></form><legend id='MfcUi'></legend><bdo id='MfcUi'><pre id='MfcUi'><center id='MfcUi'></center></pre></bdo></b><th id='MfcUi'></th></span></q></dt></tr></i><div id='MfcUi'><tfoot id='MfcUi'></tfoot><dl id='MfcUi'><fieldset id='MfcUi'></fieldset></dl></div>
      <bdo id='MfcUi'></bdo><ul id='MfcUi'></ul>
  • <small id='MfcUi'></small><noframes id='MfcUi'>

  • <tfoot id='MfcUi'></tfoot>

  • <legend id='MfcUi'><style id='MfcUi'><dir id='MfcUi'><q id='MfcUi'></q></dir></style></legend>

      1. Gradle:类路径和编译依赖有什么区别?

        Gradle: What is the difference between classpath and compile dependencies?(Gradle:类路径和编译依赖有什么区别?)

          <tfoot id='mbd1w'></tfoot>

            <tbody id='mbd1w'></tbody>
            <bdo id='mbd1w'></bdo><ul id='mbd1w'></ul>
            • <i id='mbd1w'><tr id='mbd1w'><dt id='mbd1w'><q id='mbd1w'><span id='mbd1w'><b id='mbd1w'><form id='mbd1w'><ins id='mbd1w'></ins><ul id='mbd1w'></ul><sub id='mbd1w'></sub></form><legend id='mbd1w'></legend><bdo id='mbd1w'><pre id='mbd1w'><center id='mbd1w'></center></pre></bdo></b><th id='mbd1w'></th></span></q></dt></tr></i><div id='mbd1w'><tfoot id='mbd1w'></tfoot><dl id='mbd1w'><fieldset id='mbd1w'></fieldset></dl></div>

              1. <legend id='mbd1w'><style id='mbd1w'><dir id='mbd1w'><q id='mbd1w'></q></dir></style></legend>

                  <small id='mbd1w'></small><noframes id='mbd1w'>

                  本文介绍了Gradle:类路径和编译依赖有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  向我的项目添加依赖项时,我永远不确定应该给它们什么前缀,例如"classpath""compile".

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

                  例如,我下面的依赖项应该是编译时间还是类路径?

                  For example, should my dependencies below be compile time or classpath?

                  另外,这应该在我的 applications build.gradle 中还是在 module 特定的 build.gradle 中?

                  Also, should this be in my applications build.gradle or in the module specific build.gradle?

                  当前 build.gradle(在应用程序级别):

                  apply plugin: 'java'
                  
                  repositories {
                      mavenCentral()
                  }
                  
                  dependencies {
                      compile 'org.hibernate:hibernate-core:5.0.5.Final'
                      compile 'mysql:mysql-connector-java:5.1.38'
                  } 
                  

                  推荐答案

                  我猜你在 中引用了 compileclasspath依赖项 {} 块.如果是这样,那些是依赖配置.

                  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.

                  compile 配置由 Java 插件创建.classpath 配置常见于 buildSrc {} 块中,其中需要为 build.gradle 本身声明依赖项(对于插件,也许).

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

                  这篇关于Gradle:类路径和编译依赖有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Maven JAVA_HOME environment variable is not defined correctly, but it is(Maven JAVA_HOME 环境变量未正确定义,但它是)
                  Java System Environment Variable(Java 系统环境变量)
                  Java -classpath option(Java -classpath 选项)
                  Read environment variable in SpringBoot(在 SpringBoot 中读取环境变量)
                  Tomcat 8 - context.xml use Environment Variable in Datasource(Tomcat 8 - context.xml 在数据源中使用环境变量)
                  Issue with JAVA_HOME(JAVA_HOME 的问题)
                  <i id='XjjwF'><tr id='XjjwF'><dt id='XjjwF'><q id='XjjwF'><span id='XjjwF'><b id='XjjwF'><form id='XjjwF'><ins id='XjjwF'></ins><ul id='XjjwF'></ul><sub id='XjjwF'></sub></form><legend id='XjjwF'></legend><bdo id='XjjwF'><pre id='XjjwF'><center id='XjjwF'></center></pre></bdo></b><th id='XjjwF'></th></span></q></dt></tr></i><div id='XjjwF'><tfoot id='XjjwF'></tfoot><dl id='XjjwF'><fieldset id='XjjwF'></fieldset></dl></div>
                  <legend id='XjjwF'><style id='XjjwF'><dir id='XjjwF'><q id='XjjwF'></q></dir></style></legend>
                1. <small id='XjjwF'></small><noframes id='XjjwF'>

                  <tfoot id='XjjwF'></tfoot>
                    <bdo id='XjjwF'></bdo><ul id='XjjwF'></ul>
                          <tbody id='XjjwF'></tbody>