Maven installation tutorial and maven tutorial

Source: Internet
Author: User

Maven installation tutorial and maven tutorial

I. Preparations

1. Confirm that JDK and later are successfully installed on your computer.

2. win10 Operating System

3. maven installation package: http://maven.apache.org/download.cgi

Ii. decompress the Maven installation package

Download the latest Maven version from the above address and decompress it to the specified directory (based on your needs). I decompress it to the D: \ install \ maven \ apache-maven-3.5.0 directory, contains bin and lib

Conf and other folders.

3. Configure Maven Environment Variables

In my computer ------- properties ------- advanced system settings --------- environment variable --------- system variable -------- new

Variable name: M2_HOME

Variable value:D: \ install \ maven \ apache-maven-3.5.0.

Find the Path and add it to the end of the environment variable value:; % M2_HOME % \ bin; // note the semicolon before

4. Check whether the environment variables of jdk and maven are successfully configured.

Open the dos window and run the command mvn-v. the information shown in shows that the installation is successful;

 

5. Modify the location of the local repository (skip this step if you do not want to modify the location of the local repository)

Maven places the downloaded class library (jar package) to a local directory (By default, maven's local repository is located in C: \ My Documents \. m2. \ repository.), If you want to redefine the location of this directory, You need to modify the configuration of the Maven local repository:

1. Create a folder in your favorite location. The path created here is (F: \ Maven \ repo)

2,Find the conf folder in the Maven installation directory, find the settings. xml file in the folder, and copySettings. xml fileStored inF: \ Maven, As shown in:

3. Modify the settings. xml file, as shown in:

4. Find the conf folder in the Maven installation directory, find the settings. xml file in the folder, and change the default repository location, as shown in Figure :( note that the settings. xml file must be modified in both places)

Based on this configuration, Maven will save the downloaded class library to F:/Maven/repo.

5. Experiment what we just did does not work. On the console, enter mvn help: system.

 

After executing this command, many files will appear under F:/Maven/repo. These files are downloaded from the central repository of maven to the local repository.

 

 

References; http://www.cnblogs.com/leefreeman/archive/2013/03/05/2944519.html

 

 

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.