1. Scope of dependence 1.1 Compile (default)
compilation (Compile) required, required for testing, runtime required, package required
1.2 provided
Required when compiling (compile), when testing (test) is required, not required at run time, not required when packaging
Usage Scenario:: Jsp-api.jar Servlet-api.jar. If these two jar packages are set to compile, then the two jar packages will be included in the project after the war package. And, our war package will be thrown into Tomcat to run, and Tomcat inside the original two jar package, will cause the jar package conflict.
1.3 Runtime
Not required at compile time, required for testing, runtime required, package required
Usage Scenario: Database driver Package
1.4 Test
Not required at compile time, required for testing, not required at run time, no packaging required
Usage Scenario: Junit.jar
2, add plug-ins
pom.xml-Right-click-maven-add Plugin
Maven runs with TOMCAT6 by default and how to switch to TOMCAT7.
pom.xml-Right-click-maven-add Plugin
Project Right-click-run as-maven Build ...
To use the command Tomcat7:run
<build>
<!--is configured with a number of plugins--
<plugins>
<plugin>
<groupId> org.apache.maven.plugins</groupid>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
< target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</ plugin>
</plugins>
</build>
The build contains a plugin