IDEA and Maven download and installation tutorial

Table of contents

1. Download IDEA

2. Download Maven

3. Maven environment variable configuration

4. Maven setting file configuration

5. Configure Maven tools on Idea


1. Download IDEA

Enter the official website: Download IntelliJ IDEA – The Leading Java and Kotlin IDE

Select the system corresponding to your computer and click the download button under the community version. 

 Click to run the exe file

Custom download path

Select according to personal needs

 Click to install

 Finish

2. Download Maven

Download address: https://maven.apache.org/download.cgi 

Note: The installation of maven depends on the installation of jdk, so you must first install jdk and configure the jdk environment variables before installing maven! !

 After downloading, just unzip it.

 3. Maven environment variable configuration

Turn on environment variables

The "Environment Variables" interface is divided into upper and lower parts. The upper part is the setting of "user variables of so-and-so", which is for the account you are currently logged into the computer; the lower part is the setting of system variables, which is for this A computer is equivalent to all accounts. For your own computer, it is recommended to configure it directly in the "System Variables" in the following section. Let’s take system variables as an example to explain:

 a. Create a new MAVEN_HOME variable in the system variables and set the variable name and variable value.

 The MAVEN_HOME variable stores maven-related path configuration

b. Configure MAVEN_HOME into the system environment variable path

 Double-click the path variable, create a new parameter, enter %MAVEN_HOME%\bin and click OK.

 The role of the environment variable path: Provides the executable file path of the command in the Windows command line. When we type the command in the command line, based on the path value in the environment variable, we find the corresponding command executable file for execution. Simply put, it is the directory parameter configured in path, which can be used in any directory on the command line.

After completing the above operations, click OK to save and close the configuration interface.

Type mvn -aversion in the cmd window and press Enter. If the following version number appears, it means that maven is installed successfully.

4. Maven setting file configuration

a. Configuration of local warehouse

Create a folder in the D drive and name it maven_repository

Open the maven installation directory and select the setting.xml file in the conf folder

 Check whether the setting has been successful. After saving, enter the console input:

 mvn help:system

  Then open the folder you just created. If a file is generated in it, it means the modification is successful.

 b. Modify Maven’s download image address to Alibaba source

 After installing Maven, you must promptly modify the image address downloaded by Maven. It is best to change it to a domestic download image, such as Alibaba Cloud Central Warehouse and Huawei Cloud Central Warehouse.

Also open the setting.xml file in the conf folder, find </mirrors>, and add the following code to the previous line of </>.

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

 5. Configure Maven tools on Idea

Guess you like

Origin blog.csdn.net/weixin_54106682/article/details/131248664