Download, configuration and installation of maven in MyEclipse

1. Download and unzip the maven package

1. Download the maven package on the official website , as shown below

2. Unzip the downloaded package into a certain file, such as the D drive

Second, configure maven environment variables

1. Right-click " This Computer " ---> Properties ----> Advanced System Settings ----> Environment Variables

2. Added the variable that specifies the maven package to the system variable

3. Adjust the Path value in the system variable

4. After the operation is completed, " OK " to save the operation

5. Check whether the configuration is successful

Open the cmd command line interface and enter: " mvn -v", the following content indicates that the configuration is successful

3. Modify the local warehouse location (optional, just ignore this step if you do not want to modify)

Maven will put the downloaded class library (jar package) under a local directory (the default address of maven in the local warehouse is C: \ Users \ admin \ .m2 \ repository), if you want to redefine the location of this directory Need to modify the configuration of Maven local warehouse:

1. Create a folder in a new location , such as my file location (D: \ maven \ repo)

2. Adjust the settings.xml file in the maven installation directory (D: \ apache-maven-3.6.3 \ conf)

①: add localRepository tag and fill in the value [localRepository: the location of the jar file after downloading from the maven central repository]

②: Add mirror tag to mirrors tag and fill in the value: configure maven domestic mirror

[Configurable or not equitable. Without mirror configuration, maven will use the central repository by default. The maven central repository is abroad. Sometimes the access will be slow, especially when downloading a large dependency, or even unable to download Situation, so in order to solve the problem of relying on download speed, you need to configure maven domestic mirror]

The Alibaba Cloud image is configured here. If you use this, you can directly paste and copy

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

3, the adjusted settings.xml files copied to the new D: \ maven next, as shown below:

 

Fourth, install maven in MyEclipse

1, click on the top menu bar of the " Window ", that appears, select the "drop-down menu in the Preferences ", select "pop in MyEclipse " under "menu Maven4MyEclipse ", the right of inspection, " the Enable Maven4MyEclipse Features " whether the hook Choose (the default is checked, if you do n’t check it, just check it)

2. Click " Installation " under the " Maven4MyEclipse " menu and the path to the " A dd ... " file maven package

3. Save in sequence after the operation

4. If the operation of "modify the location of the local warehouse" is not performed, ignore this step. If yes, you need to specify "User settings"

①: Click " User settings " under the " Maven4MyEclipse " menu , we can see that the default warehouse address

②: Change the default address: " B rowse ... " The path of the settings.xml file , and save the operations in sequence

5. View the maven mirror address (only the central warehouse information is displayed without mirror configuration)

①: MyEclipse in the upper right corner of the search "Maven" (generally written one or two letters to search out), click on the Maven repository "Maven Repositories"

②: Open " Global Repositories " to see related information

At this point, all operations are completed!

Published 77 original articles · 100 likes · 70,000+ views

Guess you like

Origin blog.csdn.net/super_DuoLa/article/details/105286506