Eclipse uses Maven to create a Web project, eclipsemaven
1. Download Maven plug-in and jdk
1. maven:
Http://maven.apache.org/download.cgi
2. jdk:
Http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
II. Environment Variable Configuration
1. jdk environment variable Configuration:
2.1.1
New variable name: java_home
Variable value: D: \ Program Files \ Java \ jdk; (jdk installation location)
2.1.2
New variable name: class_path
Variable value: % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar;
2.1.3
Modify variable name: Path
Variable value: append after the original variable value; % jdk_home % \ bin; % jre_home % \ bin
2. Configure Maven environment variables:
2.2.1
New variable name: MAVEN_HOME
Variable value: D: \ Program Files \ apache-maven-3.3.9 (maven installation location)
2.2.2
Modify variable name: Path
Variable value: append after the original variable value; % MAVEN_HOME % \ bin
3. test whether the environment variable configuration is correct.
Open cmd, enter java-version, and mvn-version to check whether the java and maven environments are correct.
The following shows that the configuration is correct:
3. Create an Eclipse project using Maven
1. Modify the repository location(The repository is used to store all jar packages that our project depends on)
In notepad, open the/conf/setting. xml file in the Maven installation directory.
Change some code as shown in:
Then, we can verify it with the command.
Open cmd and enter mvn help: system.
The result is displayed successfully.
In this case, open F: \ maven \ res and you will find some more files in it. These files are downloaded from the maven central repository to the local repository.
2. Configure Eclipse
Open Windows-> Prefrences, search and enter maven to expand the Maven configuration interface,
Click Installations-> add
Enter the Maven installation location and name, and click Finish.
Select the new option, click Apply, and click OK.
Open Windows-> Prefrences, search and enter maven to expand the Maven configuration interface,
Click User Settings to enter the repository path in the corresponding location of settings, click Apply, and click OK
3. Create a project
Create a Maven Project and select
Create a simple project (no skeleton is used)
Click Next
Click Finish. The project is created and the structure is
Convert to dynamic web project