Configuring Maven skills in Eclipse

Configuring Maven in Eclipse

Specify the path to configure and install maven

Mavan local warehouse with Eclipse:

Instead of the warehouse and setting we configured, you can also use the default one

relation setting.xml file

to configure setting.xml , plus Alibaba proxy image
It will be slow to download jar directly from the address of the central warehouse abroad, so we need to download it by proxy

<!-- Alibaba proxy image address -->
<mirror>
	<id>alimaven</id>
	<name>aliyun maven</name>
	<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
	<mirrorOf>*</mirrorOf>
</mirror>

  

Add Tomcat plug-in
It is very troublesome to manually add the dynamic web project to wabapp of tomcat, which is not efficient in the development process. At this time, we can integrate Tomcat plug-ins in the project to quickly deploy and run.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.dpb</groupId>
	<artifactId>MavenDemo01</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>war</packaging>

	<dependencies>
		<!-- the reason being that web The project needs servlet -->
		<!-- https://mvnrepository.com/artifact/javax.servlet/servlet-api -->
		<dependency>
		    <groupId>javax.servlet</groupId>
		    <artifactId>servlet-api</artifactId>
		    <version>2.5</version>
		    <scope>provided</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<!-- tomcat plug-in unit -->
			<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId>tomcat7-maven-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<!-- Port number -->
					<port>8082</port>
					<!-- /Indicates access path omits project name -->
					<path>/</path>
					<!-- Set encoding method -->
					<uriEncoding>utf-8</uriEncoding>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

  

function:

Type: tomcat7:run and run
Downloading some resources for the first time will be slow.

Tags: Java Maven Tomcat Apache Eclipse

Posted on Fri, 22 May 2020 12:14:10 -0400 by en