Maven (v)----Dependencies & Add Plugins

Source: Internet
Author: User
Tags tomcat


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.