看破devops 安装 参考资料

gradle 5.4.1

安装

先确保本机有jdk。

官网下载地址,选Complete下载

1
2
3
4
5
6
Installing manually
Step 1. Download the latest Gradle distribution
The current Gradle release is version 5.4.1, released on 26 Apr 2019. The distribution zip file comes in two flavors:

Binary-only
Complete, with docs and sources

解压

1
2
3
$ unzip -d /Users/nitaoge/service gradle-5.4.1-bin.zip
$ ls /Users/nitaoge/service/gradle-5.4.1
LICENSE NOTICE bin getting-started.html init.d lib

添加环境变量

1
2
3
4
5
6
$ sudo vim /etc/profile

export gradle_home=/Users/nitaoge/service/gradle-5.4.1
export PATH=$gradle_home/bin:$PATH

$ source /etc/profile

安装成功

1
2
3
4
5
6
7
8
9
10
11
12
$ gradle -v

------------------------------------------------------------
Gradle 5.4.1
------------------------------------------------------------

Build time: 2019-04-26 08:14:42 UTC
Revision: 261d171646b36a6a28d5a19a69676cd098a4c19d

Kotlin: 1.3.21
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018

参考资料

  • 官方用户手册
  • 《实战Gradle》 版本1.7太低,有些属性已废弃,不如直接看官网