Maven installation and Maven Installation
1. First download apache-maven-3.3.9-bin.zip and decompress it;
2. The portable system variable maven_home. the value is the decompression path of apache-maven-3.3.9-bin.zip:
Add the following in the path variable:
%MAVEN_HOME%\bin;
3. Enter the command mvn-version to check whether the installation is successful:
4. Edit % MAVEN_HOME %/conf/settings. xml and specify the path of the local library in the file:
<localRepository>E:\m2\repository</localRepository>
When building a Maven project, Maven first searches for resources from the local database. If the local database does not exist, Maven downloads resources from the remote database to the local database, the next time you use it, you do not need to download it from the remote database.
Configure mirror:
<mirrors> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors>
The mirror is equivalent to an interceptor that redirects requests to remote repositories to the address specified by mirror. The code above redirects requests to central to http://maven.aliyun.com/nexus/content/groups/public /.
5. In Eclipse, choose Windows> Preferences> Maven> Installations, Add the newly installed Maven, and set it to the newly installed Maven:
In this way, Maven can be used in Eclipse.