Convert Maven web project to eclipse dynamic web project facets

Source: Internet
Author: User


1. Import Maven web project.

2. MAVEN => Update Pproject Configuration

3. project Properties => Project facets => convert to faceted form => select "dynamic web module" => click "further configuration available", change the 'content directory to your current folder, like 'src \ main \ webapp'

4. Make sure Maven dependencies embedded during run on Tomcat 7 by: Project Properties => deployment Assembly => Add => "Maven dependencies"


Run on server now will work.


Take care about the maven dependency issue, here is a solution for it.

Http://stackoverflow.com/questions/6083501/maven-dependecies-not-visible-in-web-inf-lib

  • You shoshould invokemvn
    package
    (Or right-click> Maven> package) and obtain a war file-<packaging>(In
    The POM) must bewar
  • Your dependencies shocould be with the default scope (if they areprovidedOrtestThey
    Will not be encoded in the archive)
  • If you are running the project as dynamic web project on a server within eclipse, then you shoshould open the project properties (right click> Properties) and select "deployment assembly ". there click "add", select "build path entries", and choose "Maven dependencies ".
    This will instruct WTP to send the maven dependencies to the server dir.

Also, you can use run as in eclipse. Create a Maven build use goal "Tomcat: Run"

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.