简介

  • Gradle是一个构建工具,用来帮助我们编译、打包App。
  • 在代码师姐有三大构建工具,Ant、Maven和Gradle。
  • 目前来说maven更成熟,资源更丰富;gradle灵活但资源少,实战经验不足。
  • maven使用基于xml的配置gradle采用了领域特定语言Groovy的配置。
  • 在maven中要引入一个依赖,示例如下:

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
    </dependency>
    
  • 而在gradle在引入依赖:

dependencies {
    compile('org.springframework:spring-core:2.5.6')
    compile('org.springframework:spring-beans:2.5.6')
    compile('org.springframework:spring-context:2.5.6')
    compile('com.google.code.kaptcha:kaptcha:2.3:jdk15')
    testCompile('junit:junit:4.7')
}

安装

  • 官网点击Install Gradle后选择最新版的Complete即可。
  • 安装教程
  • 目前是安装5.2.1版,目录为E:/gradle-5.2.1。