Create MAVEN projects under Eclipse and deploy to Tomcat server (GO)

Source: Internet
Author: User
Tags tomcat server

There are many ways to deploy a MAVEN project to a server that can take advantage of jetty-maven-plugin or tomcat-maven-plugin, which is a maven knowledge point.

Typically in development, the project needs to be placed on the server with a development tool for debugging, and here's a look at creating a Maven project in Eclipse and transforming it to be deployed to Tomcat integrated in Eclipse.

1. Click File-->new-->project, select Maven Project, click Next

2 Select the Java working set where the project is located, click Next

3. Select all catalogs in the catalog, select Maven-archetype-webapp in the options below, click Next


4. Fill in the group ID Artifact ID and other options, click Finish

5. At this point, a MAVEN project has been created, but it will be further set up

Right-click on the project name, select Properties, select Project Facets in the tree on the left, and tap convert to faceted on the right.

6. On the popup window, tick the dynamic Web Module, select 2.5 for the version number, (3 with TOMCAT7 support only). Click Apply-->ok

7. After completing the previous setup, the project directory structure, a more webcontent directory, which is not compliant with the MAVEN project directory structure, we can copy the WebContent directory Meta-inf under the WebApp directory, You can then delete the WebContent directory.

8. The directory structure that you get after completing the previous step is as follows

9. Right-click on the project, New-->source Folder, named Src/main/java, for storing Java files

10 the project structure after adding the source Folder is as follows

11. Set deployment Assembly. Right click on the project, select Properties, select Deployment Assembly, in the right window will webcontent delete.

12. under Deployment Assembly Click Add, Pop Up the following window, click Folder, select Src-->main-->webapp, click Done, continue to click Add to select Java Build Path Entries, select Maven Dependencies, click Done

13. Finally, the results obtained from Deployment assembly are as follows

At this point, the MAVEN project can already be deployed to the Tomcat server, and we start the server for testing

Result is

Create MAVEN projects under Eclipse and deploy to Tomcat server (GO)

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.