Windos系统的Maven环境配置

JDK版本要求

Maven 3.3 需要 JDK 1.7 或更高
Maven 3.2 需要 JDK 1.6 或更高

下载Maven

地址:https://maven.apache.org/download.cgi
在这里插入图片描述

配置环境变量

新建环境变量:MAVEN_HOME,变量值:D:\Development\install\apache-maven-3.6.3
备注:根据自己的实际路径配置
在这里插入图片描述
编辑系统变量Path,添加 %MAVEN_HOME%\bin
在这里插入图片描述

设置本地仓库

默认仓库路径为用户目录下的 .m2/respository
要修改默认位置,在%MAVEN_HOME%\conf目录中的setting.xml中定义,增加 localRepository 节点
备注:根据自己实际路径配置
在这里插入图片描述

阿里云仓库

Maven仓库默认在国外,可以更改为阿里云仓库
1.在%MAVEN_HOME%\conf目录中的setting.xml中定义,在 mirrors 节点下增加 mirror节点

<mirrors>
  <mirror>
    <id>alimaven</id>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    <mirrorOf>central</mirrorOf>        
  </mirror>
</mirrors>

在这里插入图片描述
2.在pom.xml中添加

<repositories>  
	<repository>  
		<id>alimaven</id>  
		<name>aliyun maven</name>  
		<url>http://maven.aliyun.com/nexus/content/groups/public/</url>  
		<releases>  
			<enabled>true</enabled>  
		</releases>  
		<snapshots>  
			<enabled>false</enabled>  
		</snapshots>  
	</repository>  
</repositories>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值