安装
下载 maven,选择 Binary zip archive。 下载地址
修改 .bash_profile 或者 .zshrc , 修改如下。并使生效 source .zshrc/.bash_profile
。
bash
export M2_HOME=/Users/用户名/Env/maven-3.6.3
export PATH=$PATH:$M2_HOME/bin
export M2_HOME=/Users/用户名/Env/maven-3.6.3
export PATH=$PATH:$M2_HOME/bin
maven的新版本 3.8.1以后版本屏蔽了http协议私库仓库,需要注意一下
Since Maven 3.8.1 http repositories are blocked.
测速
测试发现2022 air m2 比15年的pro快了不到一倍。
shell
mvn package -Dmaven.test.skip=true
mvn package -Dmaven.test.skip=true
shell
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:38 min
[INFO] Finished at: 2022-09-16T13:23:24+08:00
[INFO] ------------------------------------------------------------------------
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:51 min
[INFO] Finished at: 2022-09-16T13:25:17+08:00
[INFO] ------------------------------------------------------------------------
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:38 min
[INFO] Finished at: 2022-09-16T13:23:24+08:00
[INFO] ------------------------------------------------------------------------
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:51 min
[INFO] Finished at: 2022-09-16T13:25:17+08:00
[INFO] ------------------------------------------------------------------------