1. Introduction to Maven
- Maven is a tool specifically used to manage and build Java projects. Its main functions are:
- Provides a standardized project structure
- Provides a set of standardized build processes (compile, test, package, release...)
- Provides a set of dependency management mechanisms
- eclipse, MyEclipse and IntelliJ IDEA have different project structures among different IDEs and are not
universal. Maven provides a set of standardized project structures. The project structures built by all IDEs using Maven are exactly the same. Maven projects created by all IDEs can pass. 2
. Maven provides a simple set of commands to complete the project build
2.Maven installation configuration
- Unzip apache-maven-3.6.1.rar and the installation is completed
- Configure the environment variable MAVEN_HOME to be the bin directory of the installation path
- Configure the local repository: modify <localRepository> in conf/settings.xml to a specified directory
- Configure Alibaba Cloud private server: Modify the <mirrors> tag in conf/settings.xml and add the following sub-tags to it.
1. Advanced environment variable configuration
2. Add system variables whose value is the installation path of maven
3. Add bin directory
3. Configure the local warehouse
The default local warehouse is on the C drive, so we need to configure it
- Modify conf/settings.xml to a specified directory as a local warehouse to store jar packages
- Configure the Alibaba Cloud private server (because the central warehouse is abroad, downloading jar packages may be slow, and Alibaba provides a remote warehouse, which basically contains jar packages for open source projects). Modify the tags in conf/settings.xml
, Add the following subtags to it
<mirror>
<id>alimaven</id>
<name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
The configuration is complete here.