Maven installation, configuration environment variables and use

1. Download the file

To use maven, you need to install the jdk environment, if you don’t have one, you can see my previous tutorial

Link: https://pan.baidu.com/s/1GiWXfcyNcdHKKC-CWbGCrw Extraction code: pri2

2. Unzip the compressed package

To any folder, it’s best to organize it into a dedicated file directory for easy searching
Insert picture description here

3. Set up the configuration file

Open the maven folder, apache-maven-3.6.1\conf
open settings.xml

Insert picture description here
Add <localRepository>H:/pacakges/jarstore</localRepository>
the folder path here is created by yourself, feel free to
Insert picture description here
insert

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

Insert picture description here

4. Configure environment variables

Create new system variable MAVEN_HOME, variable value: maven folder path
Insert picture description here
Edit system variable Path, add variable value: ;%MAVEN_HOME%\bin
Insert picture description here

5. Test

Insert picture description here

6. Use idea to create a new maven project

Create a new projets and select maven to
Insert picture description here
set the package name and project name
Insert picture description here
. If there is no automatic location, you need to manually select the maven directory. The jarstore is created by yourself, change it to a suitable path
Insert picture description here

Add an attribute in the interface below, archetypeCatalog = internal
Insert picture description here

Finish,
Insert picture description here
wait for him to download
Insert picture description here
it and modify it to jdk version (I am 1.8) after the download is complete, and change it to 4.12 below
Insert picture description here

Guess you like

Origin blog.csdn.net/zmzdmx/article/details/108401283