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.
Well, it's exhausting to cut so many pictures. But I hope to be of some help to everyone.
Using MAVEN to manage project jar packages under "Java Web" MyEclipse