Home  >  Article  >  Java  >  Detailed explanation of the example of converting Maven into Dynamic Web Module

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

零下一度
零下一度Original
2017-07-17 09:38:041405browse

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 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
Updated May 23, 2011 by cm2 ...@gmail.com
Create a Web project
Use eclipse ee to create a maven web project

//eclipse To install the maven plug-in, use m2eclipse here 1. Select File->New- >Other, select Maven->Maven Project

2. Select Use default Workspace location default workspace, no need to select others

3. Select maven-archetype-webapp in Artifact Id

4. Enter the Group ID, Artifact ID, and Package

Group ID generally writes the project name. Artifact ID is the name of the sub-project.
For example, Spring's web package, Group ID: org .springframework,artifactId:spring-web.
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!

Statement:
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