将maven、gradle仓库迁移到d盘
maven安装配置到D盘
-
直接解压到D盘
-
配置
# 环境变量
MAVEN_HOME= D:\software\apache-maven-3.6.3
Path= %MAVEN_HOME%\bin
# 配置setting.xml
# 指定本地仓库
<localRepository>D:\.m2\repository</localRepository>
# 指定阿里云镜像
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
# 新建文件夹D:\.m2\repository,将maven安装目录下的settings.xml复制到D:\.m2路径下
# 打开cmd测试
C:\Users\dogle>mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: D:\software\apache-maven-3.6.3\bin\..
Java version: 1.8.0_381, vendor: Oracle Corporation, runtime: D:\software\Java\jdk-1.8\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
- idea配置maven
-
使用idea构建maven项目或springboot项目,pom.xml中添加依赖,点击右上角图标拉取jar包
-
查看本地仓库,成功
gradle安装配置到D盘
-
直接解压到D盘
-
在init.d文件夹创建init.gradle文件
点击查看详情
allprojects {
repositories {
mavenLocal()
maven { name "Alibaba" ; url "https://maven.aliyun.com/repository/public" }
maven { name "Bstek" ; url "https://nexus.bsdn.org/content/groups/public/" }
mavenCentral()
}
buildscript {
repositories {
maven { name "Alibaba" ; url 'https://maven.aliyun.com/repository/public' }
maven { name "Bstek" ; url 'https://nexus.bsdn.org/content/groups/public/' }
maven { name "M2" ; url 'https://plugins.gradle.org/m2/' }
}
}
}
- 配置环境变量
GRADLE_HOME = D:\software\gradle-7.6
GRADLE_USER_HOME = D:\.gradle
PATH = %GRADLE_HOME%\bin
M2_HOME = D:\software\apache-maven-3.6.3
- 打开cmd验证
C:\Users\dogle>gradle -v
------------------------------------------------------------
Gradle 7.6
------------------------------------------------------------
Build time: 2022-11-25 13:35:10 UTC
Revision: daece9dbc5b79370cc8e4fd6fe4b2cd400e150a8
Kotlin: 1.7.10
Groovy: 3.0.13
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 1.8.0_381 (Oracle Corporation 25.381-b09)
OS: Windows 11 10.0 amd64
-
idea配置gradle
-
使用idea构建gradle项目或springboot项目,build.gradle中添加依赖,点击右上角图标拉取jar包
-
查看本地仓库,成功