Create a MAVEN project based on Eclipse

Source: Internet
Author: User

I. Creating a Project

Create a project with Maven in 1.Eclipse

In next

2. Continue Next

3. After selecting Maven-archetype-webapp, next

4. Fill in the appropriate information, packaged is the default to create a package, do not write or

5. After creating the project, the directory is as follows:

At this point, the project has been created, but the configuration below.

Two. Project configuration

1. Add Source Folder

MAVEN requires that you create the following source Folder

Src/main/resources

Src/main/java

Src/test/resources

Src/test/java

Add the above source Folder

The following directories are created:

2. Configure the Build Path

3. Set the output of the 4 Folders folder, double-click Modify

Modify the output path separately to

Src/main/resources Correspondence Target/classes

Src/main/java Correspondence Target/classes

Src/test/resources Correspondence Target/test-classes

Src/test/java Correspondence Target/test-classes

4. After modification, as

5. Setting libraries

6. After configuring the build path, the directory is as follows:

7. Convert the project to dynamic WEB project

Right-click Properties on the Project

Select Project Facets on the left and click Convert faceted from on the right

8. Modify Java as the JDK for your current project, add the dynamic Web Module, and then click the further Configuration available link:

9. Modify the content directory to Src/main/webapp, click OK:

10. After setting content Directory,ok, click the previous interface OK again to complete the conversion to dynamic WEB project

11. Set up Deployment assemblies (Web Deployment Assembly)

Right-click on the project, select Properties, select Deployment Assembly on the left

12. Set the file publishing path at deployment time

1, we delete the two items of test, because tests are used for testing and do not need to be deployed.
2, set the Maven jar package to be published under Lib.
ADD, Java Build Path Entries, Maven Dependencies, Finish

After Setup is complete

After OK, the Web project is created and the directory organization

After running access to the project successfully!

Create a MAVEN project based on 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.