Maven installation and configuration in Idea

1. What does Maven do?

Maven is a project management and build automation tool (project build, management, jar download)

2. Maven download

Address: https://maven.apache.org/download.cgi

3. Download and unzip

4. Environment configuration

My Computer -> Properties -> Advanced System Settings -> Environment Variables -> System Variables -> New M2_HOME

5. Edit the path path under the system variable, and add M2_HOME (%M2_HOME%\bin)

6. Open the command line window, enter mvn -v, if the Apache Maven version number appears, it means that the maven configuration is successful. Note: Before installing Maven, you must ensure that your java environment has been successfully installed, and enter java -version to query

7. Idea usually automatically integrates maven, and the version is generally a little lower. You can configure your own maven environment in idea

File->Settings->Build,Execution,Deployment->Build Tools->Maven   如下图:

Configure Maven home directory: path and User settings file: path

8. Because maven relies on downloading from abroad, it is usually very slow when building a project. At this time, it is best to change the maven central warehouse to a domestic address. Here we recommend the Alibaba Cloud mirror warehouse

Find the maven directory-conf->Settings.xml file, copy a section of <mirror> and modify it as follows: and save

<mirror>
      <id>alimaven</id>
      <mirrorOf>central</mirrorOf>
      <name>ali maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
   </mirror>

 

 

Guess you like

Origin blog.csdn.net/m0_38116456/article/details/113270313