E Clipse Creating a maven project dynamic Web Project
Note: The Eclipse version is (version:mars.1 release (4.5.1)) Maven version is (apache-maven-3.3.9)
1.
This is done after you have installed the MAVEN plugin and configured your maven environment to specify your maven local repository. Start the maven Web Project Setup below
First: Click Create a new project maven
2. Click Next
3. Select web options
4. create the coordinates of your project click Finish
5. project creation completed with errors
6. Right click on Project Find properties Modify jdk for own JDK
7. Remove errors and change java ee to 3.0 Error We continue to solve the path he came to our project Oh ~
8. Locate the project file
9. see the following file
Modify the first file as follows
10.1 This is the original file.
The following is the modified file
10.2 Open a second file
Modify the file as follows
11.web.xml files are automatically generated by 2.3 We're going to replace him.
The code is as follows :
1 <?XML version= "1.0" encoding= "UTF-8"?>2 3 <Web-appversion= "3.0"4 5 xmlns= "Http://java.sun.com/xml/ns/javaee"6 7 Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"8 9 xsi:schemalocation= "Http://java.sun.com/xml/ns/javaeeTen One http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd "> A - <Display-name>Archetype Created Web Application</Display-name> - the </Web-app>
Right-click the project close Project closed projects When you double-click Open, you will see 3.0 automatically selected
Next we add the following code to the pom.xml file
Code as follows to facilitate everyone to copy and paste
1 <Build>2 3 <Finalname>BQ</Finalname>4 5 <Plugins>6 7 <plugin>8 9 <groupId>Org.apache.tomcat.maven</groupId>Ten One <Artifactid>Tomcat7-maven-plugin</Artifactid> A - <version>2.2</version> - the </plugin> - - </Plugins> - + </Build>
Run the mavenweb project under Tomcat
A. The input command is only used here with TOMCAT7
control print run successfully
Access Success
If there is a problem, kill your local warehouse and re-get a new one because the plug-in is likely to download to half the middle there is no download asked He's not going to break it. this will cause your plugin to get an error.
Eclipse creates a MAVEN project Dynamic Web project (problems)