I'm a pro-test effective
Create a new MAVEN project first
Modify the. Project file: Copy the following MAVEN project. Project code into the. project file under the Web engineering root path.
Label (if the code exists, you don't need to copy it)
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments></arguments> </buildCommand>
Copy the following code under the label in the. project file under the engineering root path (if the code exists, you do not need to copy it)
<nature>org.maven.ide.eclipse.maven2Nature</nature>
modifying. classspath files
Modify the. classpath file under the Web project according to the classpath file of the MAVEN project
Reboot myeclipse add pom file As for Web projects:
<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= /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>org.xxx</groupId> < Artifactid>org.xxx.xxx</artifactid> <version>0.0.1-SNAPSHOT</version> <packaging>jar </packaging> <name>org.zhxie.mybaits.trymvn</name> <url>http://maven.apache.org</url > <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </prope rties> <dependencies> <dependency> <groupId>junit</groupId> <ARTIFACTID&G t;junit</artifactid> <version>3.8.1</version> <scope>test</scope> </depen dency> </dependencies> </project>
Done