In the Last post we described maven download, install and configure (ii), this post we configure Eclipse, combine it with MAVEN, and we create a MAVEN project.
Preparatory work
Before eclipse configures Maven, we need to be prepared to do the following:
1. Installing the JDK
2. MAVEN is installed and the MAVEN configuration is successful
3. Download Eclipse, unzip the installation, and create a workspace.
These things believe that everyone has pro, if not, please look at the last blog post, here is no longer tired of the description.
Eclipse Configuration Maven
Check that the Maven plugin for Eclipse is installed successfully.
If the Maven plugin is not installed, we need to install the MAVEN plugin first.
Installing the MAVEN Plugin
The Eclipse installation plugin is used in two ways, online and offline. Both of these installation methods I recommend that you use offline, offline way more convenient, simple, the two installation methods on the Internet a lot of information, but also very simple, I will no longer be tired of the statement. Recommend an article to everyone:
Several ways to install the Eclipse Maven plugin
Configure Maven
- Configuring the MAVEN installation directory
Open window–> perferences–> maven in turn, expand MAVEN's configuration interface, such as;
Then click installations–> Add to select the Maven install directory, here my Maven install directory for D:\maven\apache-maven-3.2.3, select your Maven install directory and click OK, then click Apply , click OK to complete
- Then, we set the user Settings in the MAVEN configuration interface
Global Settings Select Settings.xml under the Conf folder in the MAVEN installation directory, 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, and if the configuration is successful for d:/maven/repository, reconfigure the previous step.
Congratulations, now that we've configured Eclipse, we're ready to create a MAVEN project.
Create a MAVEN project
- We'll click on the File->new->other->maven in the Eclipse menu bar and we'll see it in the popup dialog box, as shown in:
- Select Maven Project, check create a simple project (skip archetype selection), then click Next
- Fill in the group ID and artifact ID, version default, packaging default is Jar,name,description optional, others do not fill
Then click Finish to:
4. In the first three steps you can create a simple MAVEN project, if we want to create a MAVEN Web project, change the packaging type of the third step to war, then click Finish:
Congratulations, our MAVEN project has been created, simple.
Next blog post, we use Nexus to build a maven, so please look forward to it.
"Project Management and build" 10-minute tutorial, Eclipse configuration maven + create MAVEN project (iii)