Blog Park has been registered for more than 20 days, has not written a blog, today to send an article, but also easy to find notes behind.
I personally have been doing Java Web development for several years, because the company is a business-oriented company, with a number of old stable technology, rarely touch the slightly new point of content,
After several years of behind, their technical ability has begun to slowly be eliminated by the trend of the times. In order to survive in the big wave of sand, I want to good refueling, starting from the basic content, steady precipitation, update their own technology library.
Do not ask for a bite to eat a big fat, only a little progress every day.
Don't say much nonsense. How do I build a Web project with maven?
First step: Create a MAVEN project first
The created directory structure is as follows
This directory structure is not what we want, so we need to change it.
Step two: Make adjustments to the directory structure
1. Select the project point right mouse button-->properties-->project Facets, remove the front of the red box, and then save
2. Then check it again, and a link will appear below this time
3. Click on this link to set up the popup page, then click OK
4. Select Deployment Assembly
The directory structure after the modification is as follows:
Step Three: Configure the Pom.xml file to add Web dependencies
<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > <modelversion>4.0.0 </modelVersion> <groupId>com.ssh</groupId> <artifactId>mvn-ssh</artifactId> <ver Sion>0.0.1-snapshot</version> <packaging>war</packaging> <dependencies> <!--SE Rvlet Basics-<dependency> <groupId>javax.servlet</groupId> <artifacti D>servlet-api</artifactid> <version>3.0-alpha-1</version> <scope>provided </scope> </dependency> <dependency> <groupid>javax.servlet</groupid> ; <artifactId>jstl</artifactId> <version>1.2</version> </dependency> < /dependencies></project>
Fourth step: Detect whether the Web environment can pass
1. Create a new JSP page
2. Configuring the Web. xml file
<welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list >
3. Launch Tomcat and access
At this point, using MAVEN to build a Web project ends
How to build a Web project using Maven