Eclipse uses Maven to create a Web project, eclipsemaven

Source: Internet
Author: User
Tags maven central

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

 

Related Article

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.