Maven download, configuration, IDEA configuration Maven


Maven download, configuration, IDEA configuration Maven

1. Maven download

1. Official website download address

https://maven.apache.org/

2. Find the download location on the official website

Insert image description here

3. Unzip the downloaded file. Just unzip it. No installation is required ( note: unzip to a non-Chinese directory without spaces )

Insert image description here
Insert image description here

2. Maven configuration

1. Core configuration file, local warehouse configuration

  1. Go to the conf directory and open the setting.xml file
  2. Configure the local repository path ( note: for non-Chinese, non-space paths, take the localRepository tag out of the comments )
    Insert image description here

2. Alibaba Cloud Image Warehouse Configuration

  1. Go to the conf directory and open the setting.xml file
  2. Configure in the mirrors tag and comment out the redundant columns.
	<mirror>
		<id>ali</id>
		<name>ali Maven</name>
		<mirrorOf>*</mirrorOf>
		<url>https://maven.aliyun.com/repository/public/</url>
	</mirror> 

3. Configure JDK version

  1. Go to the conf directory and open the setting.xml file
  2. Configure in the profiles tag and configure the required version
      <profile>
      <id>jdk-1.8</id>
      <activation>
		  <activeByDefult>true</activeByDefult>
		  <jdk>1.8</jdk>
      </activation>
	  <properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
	   </properties>
    </profile>

4. Environment variable configuration

  1. Check the Java environment variable configuration, java -version
    Insert image description here

  2. Configure MAVEN_HOME and find the maven directory
    Insert image description here

  3. Configure Path, %MAVEN_HOME%/bin directory
    Insert image description here

  4. Check whether the maven configuration is successful, mvn -v
    Insert image description here

3. IDEA configures Maven

1. Find the location set by Maven and perform the following operations to prevent the jar package from automatically downloading to the default location and occupying system space.

Insert image description here
or
Insert image description here

2. Configure the Maven warehouse

Insert image description here

Guess you like

Origin blog.csdn.net/s17856147699/article/details/128912141