Article directory
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
3. Unzip the downloaded file. Just unzip it. No installation is required ( note: unzip to a non-Chinese directory without spaces )
2. Maven configuration
1. Core configuration file, local warehouse configuration
- Go to the conf directory and open the setting.xml file
- Configure the local repository path ( note: for non-Chinese, non-space paths, take the localRepository tag out of the comments )
2. Alibaba Cloud Image Warehouse Configuration
- Go to the conf directory and open the setting.xml file
- 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
- Go to the conf directory and open the setting.xml file
- 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
-
Check the Java environment variable configuration, java -version
-
Configure MAVEN_HOME and find the maven directory
-
Configure Path, %MAVEN_HOME%/bin directory
-
Check whether the maven configuration is successful, mvn -v
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.
or