brew提供了便捷的maven安装方式,并且目前在m1芯片的mac上,brew也会自动帮我们装上arm版本的软件(如果已经更新)。
% brew search maven #使用搜索工具去搜索maven包 % brew info maven #使用info查看maven包当前的信息情况,包括版本依赖描述等 maven: stable 3.8.4 (bottled) Java-based project management https://maven.apache.org/ Conflicts with: mvnvm (because also installs a 'mvn' executable) /opt/homebrew/Cellar/maven/3.8.4 (79 files, 10MB) * Poured from bottle on 2021-12-11 at 01:35:47 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/maven.rb License: Apache-2.0 ==> Dependencies Required: openjdk ✔ ==> Analytics install: 77,138 (30 days), 213,336 (90 days), 671,866 (365 days) install-on-request: 76,660 (30 days), 211,765 (90 days), 667,184 (365 days) build-error: 0 (30 days)
你可以去homebrew官方网站查看maven安装包的详细信息。https://formulae.brew.sh/formula/maven 可以看到我们jdk已经装过了,没问题,直接安装maven。
% brew install maven #执行安装命令 Running `brew update --preinstall`... ==> Downloading https://ghcr.io/v2/homebrew/core/maven/manifests/3.8.4 ######################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/maven/blobs/sha256:6e032d44f0fef2a59373945e95b7f7522e4dc95069498b54fe9075d065883b5d ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:6e032d44f0fef2a59373945e95b7f7522e4dc95069498b54fe9075d065883b5d?se=2021-12-10T17%3A45%3A00Z&sig=46FG2QGnp%2BipfJwRP8rl ######################################################################## 100.0% ==> Pouring maven--3.8.4.arm64_monterey.bottle.tar.gz