maven-creating a Maven project in eclipse

Source: Internet
Author: User

Using MAVEN with eclipse requires installing the Maven plugin for Eclipse, specifically installing MAVEN plugin installation related articles

Building a MAVEN Project

Taking eclipse3.6 as an example

1) Create a simple MAVEN project

Click the Eclipse menu bar File->new->ohter->maven to get the dialog box as shown:

Select Maven Project and click Next

Go to the next dialog box and click Next to get the following dialog box

Select Maven-archetype-quickstart, click Next

Fill in the GroupID, artfactid,version and other information as shown, click Finish.

As a result, we have successfully created a simple MAVEN project with a project structure

2) Creating a MAVEN Web project

Action is similar to creating a simple Maven project, click the Eclipse menu File->new->other->maven->maven project

In the Select Maven-archetype interface, do the following:

Click Next, fill in the appropriate groupid,artifactid,version and other information, click Finish

The resulting MAVEN Web 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 the XML file My-app-web/.settings/org.eclipse.wst.common.project.facet.core.xml, modify it:

<?XML version= "1.0" encoding= "UTF-8"?><Faceted-project>  <fixedfacet= "Wst.jsdt.web"/>  <installedfacet= "Java"version= "1.5"/>  <installedfacet= "Jst.web"version= "2.3"/>  <installedfacet= "Wst.jsdt.web"version= "1.0"/></Faceted-project>
3) Importing MAVEN projects

In Eclipse Project Explorer, right-click and select Import in the pop-up box to get as shown:

Select Existing Maven Projects and click Next to get the dialog box as shown:

Select a MAVEN project that has been created and click Finish.

As a result, importing MAVEN projects successfully

3. Run the MAVEN command

Right-click the project and click Run as, such as:

You can see a lot of existing MAVEN commands, click to run, and see the running information in the console

If the MAVEN command you want to run is not found here, click Maven Build to create a new command, as shown in the following:

If you fill in the Maven command, click Run

The new Maven command can be found in the following ways and run again:

The problems encountered

New Maven Project did not maven-archetype-quickstart this item, you can find maven-archetype-quickstart-1.1.jar[url:http:// Mirrors.ibiblio.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.1/ Maven-archetype-quickstart-1.1.jar], and then add the URL. Such as

Source: HTTP://WWW.VILUO.COM/POST/55

maven-creating a Maven project in eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.