reprint: http://www.iteye.com/topic/1123225
1. Installing the m2eclipse plugin ?
to use Eclipse Build Maven project, we need to install first Meeclipse Plugins ?
Click the Eclipse menu bar help->eclipse Marketplace search for plugins Maven integration for Eclipse and click Install, such as:
after the installation, we Eclipse in the menu bar, click File->new->other, in the popup dialog box, you will see the following:
2.? Build Maven Project ??
in eclipse3.6 as an example
Create a simple Maven Project
Click Eclipse Menu Bar File->new->ohter->maven get the dialog box as shown:
selected Maven Project and click Next To continue clicking on the next dialog box Next get the following dialog box
operation, select Maven-archetype-quickstart , click Next
? Fill in the picture as shown. GroupId, Artfactid,version and other information, click Finish .
as a result, we have successfully created a simple Maven project, Project structure
2 ) to create Maven Web Project
operation and Creation Simple Maven similar to the project, click Eclipse Menu File->new->other->maven->maven Project
in the Select Maven-archetype interface to do the following:
Click Next, fill in the appropriate groupid,artifactid,version and other information, click Finish
Get the Maven Web The project structure looks like this:
? Right-click the project and click Properties->project Facets
If you can see the project as web2.3 java1.5 Of course we can also change to the version we need, open XML file My-app-web/.settings/org.eclipse.wst.common.project.facet.core.xml , you can make changes:
Xml Code ??
-
- <?xml ? version="1.0"? Encoding="UTF-8"?>??
-
- <faceted-project> ??
-
- ?? <fixed? Facet="Wst.jsdt.web"/>??
-
- ?? <installed? Facet="java"? Version="1.5"/>??
-
- ?? <installed ? Facet= "Jst.web" ? Version= "2.3" /> ?? /li>
-
- ?? <installed? Facet="Wst.jsdt.web"? Version="1.0"/>??
-
- </faceted-project> ??
3 ) Import Maven Project
in the Eclipse Project Explorer Right-click in the pop-up box and select Import , get as shown: ??????????
Select Existing Maven Projects , and click Next , get the dialog box as shown:
Select an already created Maven project, and click Finish .
From this, import Maven Project Success
3.? Run Maven Command
Right-click the project and click Run as , such as:
you can see that there are many existing maven command, click to run, and you can see the running information in the console
If you want to run the maven command is not found here, click on Maven Build Create a new command, as shown in the following:
such as filling in Maven command, click Run can be
the new maven the command can be found in the following ways and run again:
Maven Combat (iii) Eclipse build maven project (GO)