MAVEN Learning---maven local repository

Source: Internet
Author: User

MAVEN's local repository is a dependency that stores all projects (plug-in jars and other files, which are downloaded by maven) to a local folder.

Very simply, when you build a MAVEN project, all the relevant files will be stored in your MAVEN local repository.

By default, MAVEN's local repository defaults to the. M2 Directory folder:

    1. Unix/mac OS x–~/.m2
    2. Windows–c:\documents and SETTINGS\{YOUR-USERNAME}\.M2
1. Update MAVEN's local library

Typically, you can change the default local repository folder under the default. M2 directory to a more meaningful name, for example, Maven-repo

Find {m2_home}\conf\setting.xml, update localrepository to another name.

{M2_home}\conf\setting.xml
<settings><!--localrepository   | The path to the local repository maven would use to store artifacts.   Default: ~/.m2/repository  <localRepository>/path/to/local/repo</localRepository>  -->< Localrepository>d:\software\yiibai.com\apache-maven\repository</localrepository>
2. Save the file

After execution, the new Maven local repository is now changed to D:\software\yiibai.com\apache-maven\repository.

Execute command:

C:\worksp> MVN archetype:generate-dgroupid=com.yiibai-dartifactid=numbergenerator-darchetypeartifactid= Maven-archetype-quickstart-dinteractivemode=false

See for example:


Tags: Maven local repository

This site is reproduced in addition to the article, are the original site or compiled
Welcome any form of reprint, but please be sure to indicate the source, respect for the work of others to create excellent examples of the tutorial
Reprint Please specify: Article reprinted from: http://www.yiibai.com/maven/maven-local-repository.html

MAVEN Learning---maven local repository

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.