1,去官网下载

https://gradle.org/releases/

 

2,gradle和maven对比

两者都是项目工具,maven属于行业标准,Gradle是后起之秀,Gradle抛弃了Maven的基于XML的繁琐配置,XML的阅读体验比较差,对于机器来说虽然容易识别,但毕竟是由人去维护的。取而代之的是Gradle采用了领域特定语言Groovy的配置,大大简化了构建代码的行数。

如下,maven和gradle在引入依赖上面的区别:

<dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
    </dependencies>
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')
    testCompile('junit:junit:4.7')
}

 

3,gradle环境配置

首先和maven一样开箱即用,直接解压到系统盘即可

IDEA中gradle的配置和使用

 

 其中user_home是我自己创建用来存放下载依赖的地方,zip压缩包是我把下载的包一块丢了进来

 

环境变量配置:

IDEA中gradle的配置和使用

path中添加:

 IDEA中gradle的配置和使用

 

 测试:gradle -v

IDEA中gradle的配置和使用

 

4,idea配置

IDEA中gradle的配置和使用

 

相关文章:

  • 2021-09-06
  • 2021-10-26
  • 2022-02-28
  • 2021-10-31
  • 2022-12-23
  • 2021-12-01
  • 2022-01-07
猜你喜欢
  • 2021-06-19
  • 2021-08-27
  • 2021-12-27
  • 2021-10-23
  • 2021-04-21
相关资源
相似解决方案