Graphic tutorial for configuring Maven on eclipse (recommended)

1. Download Maven version

Official website address: http://maven.apache.org/download.cgi

Download Maven directly: https://mirrors.tuna.tsinghua.edu.cn/apache//maven/

The suffix is tar GZ can be used on Linux systems, and the suffix is zip, which can be directly used on Windows systems

Binary means the compiled binary file, and source means the source code is included

2. Modify Maven configuration file parameters (take apache-maven-3.3.9 as an example)

apache-maven-3.3. 9→conf→settings. XML (mainly to find the configuration file), and perform the following operations in the configuration file

2.1 find the < localrepository > / path / to / local / repo < / localrepository > statement in the comment, cancel the comment of the statement and set it

Set the local warehouse (the location where the downloaded files and jar packages are stored according to the dependency, and the path is customized)


D:/maven/r2/myrepository

2.2 modified JDK Version ()

Maven 3.3 + requires JDK 1.7 or later to execute - they still allow you to build 1.3 and other JDK versions by using toolchains

Set < profiles > within the < profiles > tag and configure the corresponding JDK version according to the actual situation

2.3 modifying the image address

3. Configure Maven on eclipse

Operation path: window → preferences → maven → installations → add

3.1 add Maven version

3.2 setting the currently used Maven version

3.3 after configuration, relevant source files can be downloaded at the same time when downloading jar packages

@H_ 404_ 102@

4. Configure Maven environment variables

M2_ Home Maven file path

5. An error occurred: Tomcat cannot find the parameter to be set

Window → preferences → Java → installed jres - → JDK edit, VM arguments add the following statement

-Dmaven. multiModuleProjectDirectory=$M2_ HOME

If there is m2 in the system variable_ Home is the system variable

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>