Install Maven using Homebrew

After homebrew is installed, installing third-party software is especially convenient to complete a line of code

brew install maven
Copy the code

Then check whether the installation is successful

mvn -v
Copy the code

So you can also see maven installation path, as shown in the figure below, installed in/opt/homebrew/Cellar/maven / 3.8.1 / libexec

Specifies that IDEA uses Maven

Open IDEA, open the configuration interface Preferences, search for Maven in the search box, and jump directly to the configuration page, as shown in the figure

By default, Maven Home Path is Bundled(Maven 3). We’ll click to the right… Use the command + up command to go back to the file directory at the upper level. Find that the /opt directory is not displayed. Use shift + Command +.(period key) to display the hidden file directory. To select all the way to the/opt/homebrew/Cellar/maven / 3.8.1 / libexec, click on the confirmation, this completes the steps

Use domestic Ali cloud mirror configuration

Open to visit, jump to the maven installation directory/opt/homebrew/Cellar/maven / 3.8.1 / libexec, then enter the conf file, use the xcode open Settings. The XML, adding in the plane mirrors option card:

<mirror>
    <id>nexus-aliyun</id>
    <mirrorOf>*</mirrorOf>
    <name>Nexus aliyun</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
Copy the code

The location is shown in the figure below

This completes the entire Maven configuration and is ready to take off. Take off, alas, fly