1.1 What is Maven

Is an open source project under Apache, is pure Java development, and only used to manage the Java project jar dependencies

1.2 Usefulness of Maven

Package management for Java projects. Dependency packages are centralized in an online repository and downloaded locally when needed. Maven projects only require configuration files, thus greatly reducing the size of Java projects.

1.3 Maven’s project dependencies

Maven’s project dependency structure is shown below:

The project can obtain the corresponding package from the local repository based on the coordinates, or request it from the central repository if it does not

1.4 Maven plugins

Maven’s core is package management, but you can extend Maven with plug-ins to make it a one-click deployment tool

Maven-compiler-plugin: used to manage compiler XML configuration:

<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.5.1 track of</version>  
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
Copy the code

Tomcat7-maven-plugin: Run Tomcat in Maven

<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId>tomcat7-maven-plugin</artifactId>
				<version>2.2</version>
				<configuration>
				 <path>/f</path>
				</configuration>
			</plugin>
Copy the code

1.5 Benefits of Maven

(1) Dependency management to save project space

(2) One-bond structure

(3) Cross-platform

(4) Application in large projects can improve development efficiency