Maven查看当前版本、环境变量、本地仓库、配置远程仓库和在本地仓库下载JAR

Maven下载、配置、目录结构、代理、本地仓库、中央仓库、远程仓库、镜像

1.Maven查看版本

cmd–>mvn -v

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: D:\apache-maven-3.3.9
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_131\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"

2.查看Maven环境变量

cmd–>echo %M2_HOME%

D:\apache-maven-3.3.9

3.查看settings.xml配置

搜索localRepository标签

C:\Users\hanchao\.m2\repository

4.修改settings.xml添加远程仓库

<profiles>
    <profile>
    <id>myRepoid>
    <repositories>
        <repository>
            <id>myRepoid>
            <name>my Repositoryname> 
            <url>http://ip:port/repository/myRepo-maven/url>
            <releases>  
                <enabled>trueenabled>  
            releases>
            <snapshots>  
                <enabled>trueenabled>  
            snapshots>
        repository>
    repositories>
    profile>
profiles>
<activeProfiles>
    <activeProfile>myRepoactiveProfile>  
activeProfiles>

5.在本地仓库下载JAR

前提:进入一个Maven项目的根目录

cmd–>mvn install

你可能感兴趣的:(Maven,Maven,repository,mvn,install,mvn,-v)