MAVEN Environment Build +eclipse plug-in installation + basic project configuration

Source: Internet
Author: User

today I learned about MAVEN environment building, and project deployment, summarized under. The company recently in the use of Maven+jekins automatic release, so there is the idea of learning, just to use the automatic test has been learning. 1. Software Download:
A.maven 3.1.1: http://download.csdn.net/detail/u012543891/6440865        of course, can also be downloaded to the official website: http://maven.apache.org/docs/3.1.1/release-notes.html --I can't keep it open . b.eclipse Download, Baidu on a lot here slightly C.JDK Installation Here, configure the environment variables .

2.maven environment variable configuration:        download Good maven3.1.1 in 1 and put it inD:\Program files\maven3.1.1 addresses are placed with personal interests. 2. 1 in My Computer-systemProperties-Advanced-Environment Variables-system environment variables-NEW:Variable Name:Maven_homeVariable Value:D:\Program files\maven3.1.1,    
2. 2 Locate the path in the system environment variable and add the variable value:%maven_home%\bin, after completion OK save.


    very good, this time Maven has been installed, to test it, Check our java environment and maven is the environment wrong, Enter mvn-v on the cmd page,


3. Modify the warehouse location

At this point, the final step is configured:Warehouse location,Modify the warehouse address, which is used to store all the items that the project relies onJarpackage. Here I set the warehouse path to:D:\Maven\repositories, set the path with your personal preference: Open the installation path for Maven in 1: D:\Program files\maven3.1.1\confunder the directorySetting.xmlfile, find the following code to modify it:


(To a little episode, last week in the configuration to go to this step has been stuck, has not been solved, today only found that because of their carelessness in the last line of the configuration is not put to-and after the configuration path is not resolved, the warehouse code has been loaded into the default path of the C drive, resulting in eclipse has not been able to connect. )

Next, use the command to verify that the configuration is successful, enter in cmd: mvn help:system,


at this point, open the above created warehouse file(D:\Maven\repositories), you'll find a lot more files.. These files are ourmaventhe central repository is downloaded to the local repository. (can also be downloaded automatically in eclipse)


4. Install the Maven for Eclipse plugin, this step will be long4.1after you have downloaded Eclipse Open, go to menu: Help-Install new software, pop-up window in work withInput:http://download.eclipse.org/technology/m2e/releases Enter,                             Now that the Maven plugin selection is displayed, the next step is to install and restart eclipse after installation.
4.2 The Maven repository path can then be configured, click Windows-Preferences,
Click Add, select the local download of the Maven file, that is, 1 download the installation of maven3.1.1, note that after the successful addition, the path in the following global settings will be changed by default
The next step is to set up the setting file, and in user settings, select the Settings.xml file in the maven3.1.1 installation file
, at this point in the local repository will know the default selection to the warehouse file path, see Figure Bar:

5.OK, all the configuration is over, go down to build a project, let eclipse automatically update the warehouse file bar, time is very slow, and so on ...

Don't talk nonsense, take a picture and record this magical moment:





Note: Build the environment encountered problems summary:

1. When the Eclipse updates the project, there is often a lack of jar package phenomenon, due to the beginning of the network problem, a lot of jar packages can not be installed successfully, so each time the project update, there are the following errors


WORKAROUND: You need to manually download these jar packages at this time, put them in the corresponding path in the configuration warehouse, update the project again

or find the folder where this file is located, delete it, and then go to the Eclipse Project's MAVEN option to re-update the project, guessing that the network is not stable download file is not complete, after the deletion update re-download.






















From for notes (Wiz)

MAVEN Environment Build +eclipse plug-in installation + basic project configuration

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.