Preparatory work
Before eclipse configures Maven, we need to prepare for the following:
1. Install JDK
2. MAVEN has been installed to successfully configure MAVEN
3. Download Eclipse, unzip installation complete, build workspace.
This content believes that everyone has been familiar with, if not, please check the previous blog, here is no longer tired to state.
Eclipse Configuration Maven
Check to see if the Maven plug-in for Eclipse is successfully installed, as shown in the figure:
If the Maven plugin is not installed, we need to install the MAVEN plugin first.
Installing the MAVEN Plugin
There are two common ways to eclipse installation Plug-ins, online and offline. These two installation methods I suggest that you use off-line, off-line way more convenient, simple, these two installation methods on the Internet a lot of information, but also very simple, I will not be tired. To recommend a piece can be:
Several ways to install the Eclipse MAVEN plug-in
Configure Maven
Configure the MAVEN installation directory to turn
on window–> perferences–> maven, expand the Maven configuration interface, as shown above;
then click installations–> Add Select Maven installation directory, here my Maven installation directory for D:\maven\apache-maven-3.2.3, select your Maven installation directory and click OK, then click Apply, click OK, and
then, We have the MAVEN configuration interface, set user settings! [Write a picture description here] (https://img-blog.csdn.net/20150528155225713)
Global Settings Select the MAVEN installation directory under the Conf folder under the Settings.xml, where my Maven installation directory is D:\maven\apache-maven-3.2.3\conf\ Settings.xml, select your Maven installation directory, check the local Repository entry, or reconfigure the previous step if D:/maven/repository is configured successfully.
Congratulations, now that we've configured Eclipse, we're ready to create the MAVEN project.
Create MAVEN Project
We click on the File->new->other->maven in the Eclipse menu bar and we'll see it in the pop-up dialog, as shown in the following image:
Here's a picture description
Select Maven Project, please select Create a Simple Project (skip archetype selection), then click Next to fill in the
group ID and artifact ID, version default, packaging default to Jar,name, Description optional, others do not fill
Then click Finish, as shown in the picture:
Here to write a picture description
4. You can create a simple MAVEN project in the first three steps, and if we want to create a MAVEN Web project, change the packaging type of the third step to war, and then click Finish, as shown in the figure:
Congratulations, our MAVEN project has also been created, simple.