The MAVEN project to Web project in eclipse runs on Tomcat

Source: Internet
Author: User
Tags tomcat
How to create Maven project in Eclipse and convert to Dynamic Web project I. Creating a MAVEN project

1. Select File->new->other->maven->maven Project from the Eclipse's menu bar
2. Next choose Create a simple project (skip archetype selection), as shown in figure

3. Next after entering group Id,archive id,packaging Click Finish, as shown in figure
How to create Maven project in Eclipse Jee and convert to Dynamic Web project

4. Create a successful file directory, as shown in figure
two. Dynamic Web Project converted to Java

1. Right click on Project's name and select Properties
2. Select Project Facets->convert to faceted from ..., as shown in figure
How to create Maven project in Eclipse Jee and convert to Dynamic Web project

3. Select the dynamic Web module,version 2.5 (3.0 version I have not tested is feasible), select java,version for 1.6, and click further configuration available ... As shown in figure

4. Modify the content directory to/src/main/webapp/, click OK, as shown

5. Finally click Properties for showcase OK to complete the conversion, the final directory structure, as shown in figure
three. Modify the Java Build Path

1. Right click on Project's name and select Properties
2. Select Java build Path, remove the JRE 1.5 version, and click the Add Library, as shown

3. Select the JRE System Library and click Next, as shown in

4. Select the Jdk6 version you set, click Finish, as shown

5. Finally click OK to complete the setup, as shown in figure
Four. Modify the Java Compile

1. Right click on Project's name and select Properties
2. Select Java Compiler and select Compiler compliance level 1.6, as shown in figure
Five. Modify Deployment Assembly

1. Right click on Project's name and select Properties
2. Select Deployment Assembly, and click Add, as shown

3. Select Java Build Path Entries, click Next, as shown in

4. Select Maven Dependencies, click Finish, as shown

5. Finally click OK to complete the setup (test can be deleted), as shown in figure

Add:
If it does not appear, it is likely that in Eclipse deployment assembly is disable, then all we need to do is to enable the Deployment assembly option.
there is a. project file in the workspace where the project is located, the file is opened to add the following line for the Enable Deployment Assembly property.
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
is added under <natures>.

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.