简体   繁体   中英

How to install and configure Maven on Macos

我正在搜索在Mac OS上安装和配置Maven的最佳方法吗?

There are two methods:

With brew installation:

Without installing brew:

  • Download the Maven, for example apache-maven-3.1.1-bin.tar.gz. Extracts it, tar -xvf apache-maven-3.1.1-bin.tar.gz

  • Set Maven command in environment variable: Update ~/. bash_profile – create this file if doesn't exist.

    ~/.bash_profile export M2_HOME=/Users/youusername/apache-maven-3.1.1 export PATH=$PATH:$M2_HOME/bin

  • Finally restart the terminal. Test it using: mvn -version

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM