1. Tomcat Run environment 2, check maven plugin (4.0 + Eclipse version comes with maven plugin) 3,Modify the Eclipse.ini file to add support for the JDK-VMC:\Java\jdk1.8.0_131\bin\javaw.exe4.Modify the default JRE for Eclipse to the private JRE location under JDK directory (typically the private JRE by default)C:\Java\jdk1.8.0_131\jre5.add maven to eclipse6.configuration of the settings.xml file7. Create a MAVEN Web projectmethod ①: method ②: = = "8, modify the default configuration at deployment (WebApp configuration) 9, add JSP page error (need to add servlet-api dependency)①
②
③ added Servlet-api dependency in the project
<!--index.jsp file error, add Servlet-api dependency--<dependency><groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId><version>2.5</version><!--dependency range: -<scope>provided</scope></dependency> |
then operate:
project-> Right-click->maven-> Update Project , so that it can be resolved (do a timely refresh of use) |
④10, modify the default JRE environment (configuration is required or do not configure)= = "
the way[1] Open settings.xml file[2] Find profiles tags[3] Add the following configuration<profile><id>jdk-1.8</id><activation><activeByDefault>true</activeByDefault><jdk>1.8</jdk></activation><properties><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target><maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion></properties></profile>
11. Access the project page in the browserusing the jetty containerNote: You can specify to run the jetty service during the packaging phase
then access the localhost:8080 in the browser
You can also use Tomcat as a web container find Maven plugins on the Tomcat website: tomcat-maven-plugin<plugins><plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat6-maven-plugin</artifactId><version>2.2</version></plugin><plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.2</version></plugin></plugins> = = "Execute the clean package:
Preparation for creating MAVEN projects in Eclipse