mac brew install gradle

12 min read

brew install gradle 安装

brew install gradle
==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/manifests/18.0.1.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/blobs/sha256:820101dd1b
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gradle/manifests/7.4.2
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gradle/blobs/sha256:36f1f1e0d0f
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Installing dependencies for gradle: openjdk
==> Installing gradle dependency: openjdk
==> Pouring openjdk--18.0.1.1.monterey.bottle.tar.gz
/usr/local/Cellar/openjdk/18.0.1.1: 641 files, 307.7MB
==> Installing gradle
==> Pouring gradle--7.4.2.all.bottle.tar.gz
  /usr/local/Cellar/gradle/7.4.2: 11,257 files, 267.8MB
==> Running `brew cleanup gradle`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

gradle -v 校验

gradle -v


Welcome to Gradle 7.4.2!

Here are the highlights of this release:
 - Aggregated test and JaCoCo reports
 - Marking additional test source directories as tests in IntelliJ
 - Support for Adoptium JDKs in Java toolchains

For more details see https://docs.gradle.org/7.4.2/release-notes.html


------------------------------------------------------------
Gradle 7.4.2
------------------------------------------------------------

Build time:   2022-03-31 15:25:29 UTC
Revision:     540473b8118064efcc264694cbcaa4b677f61041

Kotlin:       1.5.31
Groovy:       3.0.9
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          18.0.1.1 (Homebrew 18.0.1.1+0)
OS:           Mac OS X 12.3.1 x86_64

配置本地repository目录

vim ~/.zshrc


GRADLE_USER_HOME=/Users/pan/.m2/repository
export GRADLE_USER_HOME


source ~/.zshrc