MAVEN Create Web Project

Source: Internet
Author: User

The steps are as follows:

  1. Ctrl + N to bring up the new window, double-click to select Maven Project
  2. Click Next directly
  3. Double-click to select Maven-archetype-webapp (this list needs to load for some time)
  4. Enter the group ID and artifact ID (project name) according to your personal situation, the package will be generated automatically, click Finish

    The project structure under Java view is as follows



  5. Right-click Project, build path, Configure build path ...
  6. Down two wrong source folder on source
  7. Click on Add Folder ... click Create New Folder ... Add Src/main/java, Src/test/java and Src/test/resources
  8. Double-click the output folder under Src/test/java and Src/test/resources, and set the class publishing directory for the test code compilation to Target/test-classes. In order to not be mixed with the official code compiled files, the official code publishing directory using the default target/classes.
  9. Adjust the order of folder display in order and export
  10. Double-click in libraries to replace the default JRE with your own JRE, as I am replacing the JRE system library [j2se-1.5] with the JRE system library [jdk1.6]
  11. Convert to a Dynamic Web project so that Tomcat recognizes
    Click on the left side of Project Facets, on the right, select dynamic Web Module-----set version to 2.5 (default 3.0 for Java7), and temporarily do not click OK
  12. Click on the further configuration available ..... set Web. XML in the directory of Src/main/webapp, Apply
  13. Click Deployment Assembly on the left to delete the two test folder that you do not need to deploy
  14. Set up a package that releases Maven dependencies simultaneously when publishing
    Click Add, double-click Java Build Path Entries, double-click Maven Dependencies-OK

    Final Project Catalog effect
  15. Deploy to Tomcat (if not clearly available on this site), visit http://localhost:8080/example/, and appear Hello world! Prove that you have succeeded!

If this content is helpful to you, welcome to click on the form of ads to support us, but please do not more than once a day, or may be identified as malicious click, resulting in the number.

MAVEN Create Web Project

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.