zoukankan      html  css  js  c++  java
  • maven安装

    转自:http://www.cnblogs.com/happyframework/p/3391691.html

    1. 下载

    地址:http://maven.apache.org/。解压缩,比如放在D:Program Filesapache-maven-3.0.4处。

    2. 环境变量配置

    配置环境变量 MAVEN_HOME=D:Program Filesapache-maven-3.0.4  把MAVEN_HOME加入到PATH中 xxxx;%MAVEN_HOME%in

    保存后,在控制台中输入mvn -version。若能输出版本信息,则maven安装成功。

    3. maven仓库配置

    maven仓库是用来放置下载到的各种Jar包的。

    在D:Program Filesapache-maven-3.0.4conf下面找到settings.xml 配置maven的仓库(当然可以默认)

    <!-- localRepository
    | The path to the local repository maven will use to store artifacts.
    |
    | Default: ${user.home}/.m2/repository
    <localRepository>/path/to/local/repo</localRepository>
    -->
    <localRepository>D:/Program Files/apache-maven-3.0.4/repositories</localRepository>  

    5. maven镜像配置

    maven镜像用来配置从哪里下载jar包。settings.xml中默认的镜像地址可能下载Jar包比较慢,可以自已配置下载快的镜像地址。比如:

    D:Program Filesapache-maven-3.0.4confsettings.xml

    <mirrors>
        <!-- mirror
         | Specifies a repository mirror site to use instead of a given repository. The repository that
         | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
         | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
         |
        <mirror>
          <id>mirrorId</id>
          <mirrorOf>repositoryId</mirrorOf>
          <name>Human Readable Name for this Mirror.</name>
          <url>http://my.repository.com/repo/path</url>
        </mirror>
         -->
         <mirror>  
          <id>repo2</id>  
          <mirrorOf>central</mirrorOf>  
          <name>Human Readable Name for this Mirror.</name>  
          <url>http://repo2.maven.org/maven2/</url>  
        </mirror>  
    <mirror>  
          <id>net-cn</id>  
          <mirrorOf>central</mirrorOf>  
          <name>Human Readable Name for this Mirror.</name>  
          <url>http://maven.net.cn/content/groups/public/</url>   
        </mirror>  
    <mirror>  
          <id>ui</id>  
          <mirrorOf>central</mirrorOf>  
          <name>Human Readable Name for this Mirror.</name>  
         <url>http://uk.maven.org/maven2/</url>  
        </mirror>  
    <mirror>  
          <id>ibiblio</id>  
          <mirrorOf>central</mirrorOf>  
          <name>Human Readable Name for this Mirror.</name>  
         <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>  
        </mirror>  
    <mirror>  
          <id>jboss-public-repository-group</id>  
          <mirrorOf>central</mirrorOf>  
          <name>JBoss Public Repository Group</name>  
         <url>http://repository.jboss.org/nexus/content/groups/public</url>  
        </mirror>  
      </mirrors>
    

    6. maven 的两份settings.xml

    settings.xml存在于两个地方:

    1.安装的地方:D:Program Filesapache-maven-3.0.4confsettings.xml

    2.用户的目录:${user.home}/.m2/settings.xml

    前者又被叫做全局配置,后者被称为用户配置。如果两者都存在,它们的内容将被合并,并且用户范围的settings.xml优先。

  • 相关阅读:
    Yocto开发笔记之《Tip-bitbake常用命令》(QQ交流群:519230208)
    Yocto开发笔记之《Tip-设置程序开机启动》(QQ交流群:519230208)
    Yocto开发笔记之《Tip-应用程序无法在目标机运行》(QQ交流群:519230208)
    激光雷达技术
    Yocto开发笔记之《网卡配置》(QQ交流群:519230208)
    Yocto开发笔记之《错误记录》(QQ交流群:519230208)
    Yocto开发笔记之《工具使用:TFTP & NFS & SSH》(QQ交流群:519230208)
    Yocto开发笔记之《U-boot启动内核流程》(QQ交流群:519230208)
    自定义选择提示框
    uitextfield输入字符限制
  • 原文地址:https://www.cnblogs.com/sunada2005/p/4000858.html
Copyright © 2011-2022 走看看