Objective
Development environment
Sts-3.7.2.release
Create step 1. Turn on Eclipse, right-click new--"Other, if you find Maven project
2. Select Maven Project, display the Create MAVEN Project window, tick, create a simple project
3. Enter the basic information for the MAVEN project as shown in:
4. Complete the creation of the MAVEN project and generate the corresponding MAVEN project results as follows:
Now this project requires us to build because it contains:
1 errors: Missing Web. XML causes pom.xml Error
The version of Maven created in this way is the J2SE version, and the JDK is the default of 1.5.
Open the Src/main directory and you can see that WebApp is empty.
5. Select the project, right-click Properties, go to the property page, and select to the Maven menu, as shown in:
6. Uncheck the following dynamic Web Module (selected by default), click Apply, and then select the following
further configuation ...(not come out more than a few times) as shown:
7. Click further configuration available ..., as follows:
\
8. Configure the Src/main/webapp, and tick the option to generate Web. XML, OK. If no modifications are made here, WebContent is generated as the publishing environment for the project.
9. Now change Java to 1.7 (that is, replace the JDK version with the 1.7 version), as below, point Apply,ok.
The WebApp directory is shown below
10. You also need to configure the root directory for the "/" project at this time, as shown below: Src/main/webapp
11. Almost forgot that biud path replaced javase with a local JDK.
Two ways to create a MAVEN project comparison
- How to create one: the practice of this blog
- Create mode two: Create maven without checking the "create a simple ..." and select the Maven-archetype-webapp template as follows:
It is recommended to use this blog creation method, because according to the creation process of this blog, the version of Web. XML of the MAVEN project that you created can be 2.5 or 3.0 (selected at build time), and if the "Create Way II" Blogger does not guarantee this.
Such as:
Wonderful "problem" description
After I created it, I found a problem: Unlike other MAVEN project constructs that are normally created:
Then Baidu, group, friends. Finally after a bit of other people, found unexpectedly: Navigation bar!!!!!!!!!
Reference URL
Building a Maven project with Eclipse (step-by-step)
Eclipse+maven Creating a WebApp Project
Eclipse creates a MAVEN project