zoukankan      html  css  js  c++  java
  • maven入门--part2 安装

    Maven安装和配置

    (1)下载安装文件apache-maven-3.03-bin.tar

    (2)解压至安装目录,安装完毕

    (3)修改.bash_profile,修改maven安装路径,修改构建GC配置参数

    vim ~/.bash_profile
    ***********************************************
    export MAVEN_HOME=path/apache-maven-3.0.3
    export PATH=$PATH:$JAVA_HOME:$MAVEN_HOME/bin
    export MAVEN_OPTS='-Xmn400m -Xms1024m -Xmx1024m -Xss1m -XX:PermSize=384m -XX:MaxPermSize=384m'
    ***********************************************
    source ~/.bash_profile
    

    (4)添加settings.xml,放在用户目录下,不用默认的settings.xml是为了每个用户都有自己的配置

    mkdir ~/.m2
    vim ~/.m2/settings.xml
    ***********************************************
    <settings>
    <!-- 配置maven本地repository的位置,可选 -->
    <localRepository>/Users/xxx/.m2/repository</localRepository>
    <!-- 配置开发者打包jar并上传nexus的用户名和密码 -->
    <servers>
            <server>
                    <id>nexus-releases</id>
                    <username>admin</username>
                    <password>xxxxx</password>
            </server>
            <server>
                    <id>nexus-snapshots</id>
                    <username>admin</username>
                    <password>xxxxx</password>
            </server>
    </servers>
    <profiles>
    <!-- 配置maven私服的地址,maven在构建时会先从私服尝试下载,如找不到再从中央仓库下载 -->
    <profile>
           <id>nexus</id>
           <repositories>
                   <repository>
                           <id>nexus</id>
                           <name>local private nexus</name>
                           <url>http://123.45.56.78:8081/nexus/content/groups/public</url>
                   </repository>
           </repositories>
           <pluginRepositories>
                   <pluginRepository>
                           <id>local-plugin-repository</id>
                           <name>local private plugin repository</name>
                           <url>http://123.45.67.78:8081/nexus/content/groups/public</url>
                           <releases>
                                   <enabled>true</enabled>
                           </releases>
                           <snapshots>
                                   <enabled>false</enabled>
                           </snapshots>
                   </pluginRepository>
           </pluginRepositories>
    </profile>
    </profiles>
    <activeProfiles>
           <activeProfile>nexus</activeProfile>
    </activeProfiles>
    </settings>
    ***********************************************

    (5)验证:mvn -version 查看安装路径,确认是不是安装成功

  • 相关阅读:
    Testlink1.9.17使用方法( 第三章 初始配置[配置用户、产品] )
    Testlink1.9.17使用方法(第二章 登录&汉化设置)
    Testlink1.9.17使用方法(第一章 前言)
    TestLink-Windows安装教程
    Linux-Redmine安装方法
    怎么使用Fiddler进行抓包
    配置ADB到Windows环境变量
    Android获取定位权限,获取设备所在的经纬度
    Paint.FontMetrics
    Bitmap上下合成图片
  • 原文地址:https://www.cnblogs.com/jijiji/p/6943967.html
Copyright © 2011-2022 走看看