Using MAVEN to manage project jar packages under "Java Web" MyEclipse

Source: Internet
Author: User

Java Web developers know that they often worry about missing a variety of jar packages and often go to various places to download them. It's easy to use MAVEN to manage your project's jar packages, and MAVEN will automatically help you download the various jar packages you need.

Here's an introduction to using Maven under MyEclipse:

1.maven environment variable Configuration

When Maven downloads the website, Baidu configures the environment variables and then detects the configuration correctly at the command line. You can refer to the configuration and detection of the JDK.

Configuring the MAVEN environment in 2.Myeclipse

2.1 in MyEclipse click: Window-->preferences, appears as follows:

Find MAVEN related entries, such as the red circle on the left. Then change the Maven JDK to the JDK version you installed, as shown on the right.

2.2 Click Installations as shown in:

In the red on the right, add your maven directory.

2.3 Click on the left user Settings as shown in:

Change the red side to the relevant file in your MAVEN directory. Then make sure it's all right.

New MAVEN Project under 3.Myeclipse

Next, you can myeclipse the new project again.

Click File-->new-->web Project and the following interface appears:

Fill in the name of the project, tick add MAVEN support, and tick myeclipse maven JEE project, tick standard MAVEN JEE project, click Next and appear as shown:

Click Finish directly, so the project is complete. As shown in the following:

, the red circle is the jar package managed by Maven, and when a jar package is needed, the configuration is added to the Pom.xml file and Maven is automatically downloaded and listed. For example, if I do spring development and need spring-related jar packages, I need to add the relevant configuration in Pom.xml, as follows:

Go to Maven's library to find spring-related configurations. Enter the following website:

Input keywords: spring to find, get as shown:

In the search results, find what you need and click Enter, such as click on Spring Context to get the following:

Then select the version of the jar package you need and click to enter. For example I clicked on 4.0.5 and got as shown:

Copy and paste the red circled code on the way to the appropriate location in the Pom.xml file in your project, as shown in:

As shown in the Red circled section of the way, paste the code under the <dependencies> tab, parallel to other <dependency>, save, MAVEN will automatically download the relevant jar package according to the configuration file. As shown in the following:

The related jar packages that Maven automatically downloads are listed as shown in. It will download the full, not the missing.

Of course if you do other development, you need the other jar package, you can follow the above method. This is very convenient, and the downloaded jar package is very full.

Using MAVEN to manage project jar packages under "Java Web" MyEclipse

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.