Home > Java > javaTutorial > body text

Detailed explanation of the example of converting Maven into Dynamic Web Module

零下一度
Release: 2017-07-17 09:38:04
Original
1500 people have browsed it

Cannot change version of project facet Dynamic web module to 2.5 will appear when the Maven project modifies the Dynamic web module to 2.5 in Project Facets. The following provides a solution

Maven is still the most commonly used today. Project management tool. If you want to use Maven to manage Java Web projects, you first need to create a new Maven project and then convert it into a web project.

Right-click on the project and select properties, then click Project Facets on the left, check Dynamic Web Module, and click Apply-->OK. Ideally, the WebContent directory should appear under the project. If not, first return to the Project Facets interface, uncheck Dynamic Web Module and click Apply. Then re-check, a "further configuration available" link will appear below, click to enter, and check to generate the web.xml file.

After WebContent is generated, cut the next two folders to src/main/webapp and delete WebContent.

Right-click the project, select properties, and select Deployment Assembly. Select <code>WebContent and remove it. Then re-specify a web path, click Add, select Folder, and click Next. Find the webapp directory under src/main and click Finish. Continue to click Add and select Java Build Path Entries. Point the current build path to Maven Dependency. Click Apply and OK.

This method seems to have no project facts option when using eclipse3.5, and it seems difficult to use <br>Updated May 23, 2011 by cm2 ...@gmail.com <br>Create a Web project <br>Use eclipse ee to create a maven web project <br><br>//eclipse To install the maven plug-in, use m2eclipse here 1. Select File->New- >Other, select Maven->Maven Project <br><br>2. Select Use default Workspace location default workspace, no need to select others <br><br>3. Select maven-archetype-webapp in Artifact Id <br><br>4. Enter the Group ID, Artifact ID, and Package <br><br>Group ID generally writes the project name. Artifact ID is the name of the sub-project. <br>For example, Spring's web package, Group ID: org .springframework,artifactId:spring-web. <br>Package builds a package for you by default, you don’t need to write it.

The above is the detailed content of Detailed explanation of the example of converting Maven into Dynamic Web Module. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template