MAVEN 3.9.1安装

WIN系统MAVEN 3.9.1安装

1. 下载

下载官网地址:Index of /dist/maven/maven-3 (apache.org)

image-20240824085514325

百度网盘:

通过网盘分享的文件:apache-maven-3.9.1-bin.zip
链接: https://pan.baidu.com/s/1VKmxrU5Hg6mbEUc43wjQUw 提取码: aua6
–来自百度网盘超级会员v5的分享

2. 配置maven

将下载好的maven文件进行解压,解压之后如下图所示:

image-20240824091807072

新建一个repository文件夹,用于存放本地的maven仓库

配置环境变量

 变量名:MAVEN_HOME
 变量值:C:\Users\A2\Desktop\apache-maven-3.9.1-bin\apache-maven-3.9.1
     //此处的变量值为你存放Maven的解压路径
 变量名:M2_HOME
 变量值:C:\Users\A2\Desktop\apache-maven-3.9.1-bin\apache-maven-3.9.1\repository
     //此处的变量值为你存放Maven的解压后目录中的文件夹的路径
     //很多自动依赖的系统,如springboot、springcloud引用了该地址,建议配置上

path中新建

%MAVEN_HOME%\bin

MAVEN配置阿里镜像源

打开conf目录下的settings.xml文件,在<mirrors>添加阿里云仓库

    <!-- 阿里云仓库 -->
    <mirror>
      <id>alimaven</id>
      <mirrorOf>central</mirrorOf>
      <name>aliyun maven</name>
      <url>https://maven.aliyun.com/repository/public</url>
    </mirror>

image-20240824100525692

配置默认的JDK版本

<profile>   
      <id>jdk15.0.2</id>
      <activation>   
          <activeByDefault>true</activeByDefault>
          <jdk>jdk15.0.2</jdk>   
      </activation>
      <properties>
          <maven.compiler.source>15.0.2</maven.compiler.source>
          <maven.compiler.target>15.0.2</maven.compiler.target>
          <maven.compiler.compilerVersion>15.0.2</maven.compiler.compilerVersion>
          <encoding>UTF-8</encoding>
      </properties>   
</profile>

配置建立本地的maven路径

大约54行左右配置本地的maven仓库

image-20240824101657124

<localRepository>C:\Users\A2\Desktop\apache-maven-3.9.1-bin\apache-maven-3.9.1\repository</localRepository>

测试Maven

执行mvn --version,出现mvn的版本,代表maven安装成功

mvn --version

image-20240824101934260

配置完成,运行mvn help:system测试,配置成功则本地仓库(C:\Users\A2\Desktop\apache-maven-3.9.1-bin\apache-maven-3.9.1\repository)中会出现一些文件。
首次执行 mvn help:system 命令,Maven相关工具自动帮我们到Maven中央仓库下载缺省的或者Maven中央仓库更新的各种配置文件到Maven本地仓库中。

mvn help:system 是 Maven 构建工具中的一个特定命令,它的主要作用是提供关于 Maven 运行环境的详细信息

mvn help:system

参考链接:全站最全Maven下载安装配置教学(2024更新…全版本)建议收藏…赠送IDEA配置Maven教程-CSDN博客
下载安装配置教学(2024更新…全版本)建议收藏…赠送IDEA配置Maven教程-CSDN博客](https://blog.csdn.net/MSDCP/article/details/127680844)

Apache Maven What is it? ----------- Maven is a software project management and comprehension tool. Based on the concept of a Project Object Model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. Documentation ------------- The most up-to-date documentation can be found at http://maven.apache.org/. Release Notes ------------- The full list of changes can be found at http://maven.apache.org/release-notes.html. System Requirements ------------------- JDK: 1.7 or above (this is to execute Maven - it still allows you to build against 1.3 and prior JDK's). Memory: No minimum requirement. Disk: Approximately 10MB is required for the Maven installation itself. In addition to that, additional disk space will be used for your local Maven repository. The size of your local repository will vary depending on usage but expect at least 500MB. Operating System: Windows: Windows 2000 or above. Unix based systems (Linux, Solaris and Mac OS X) and others: No minimum requirement. Installing Maven ---------------- 1) Unpack the archive where you would like to store the binaries, eg: Unix-based operating systems (Linux, Solaris and Mac OS X) tar zxvf apache-maven-3.x.y.tar.gz Windows unzip apache-maven-3.x.y.zip 2) A directory called "apache-maven-3.x.y" will be created. 3) Add the bin directory to your PATH, eg: Unix-based operating systems (Linux, Solaris and Mac OS X) export PATH=/usr/local/apache-maven-3.x.y/bin:$PATH Windows set PATH="c:\program files\apache-maven-3.x.y\bin";%PATH% 4) Make sure JAVA_HOME is set to the location of your JDK 5) Run "mvn --version" to verify that it is correctly installed. For complete documentation, see http://maven.apache.org/download.html#Installation Licensing --------- Please see the file called LICENSE.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值