改变maven仓库位置_maven 如何修改仓库repository 位置

1 测试maven 是否已经安装成功mvn -version

Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T07:57:3

7-04:00)

Maven home: C:\apache-maven-3.3.3\bin\..

Java version: 1.7.0_75, vendor: Oracle Corporation

Java home: C:\Java\jdk1.7.0_75\jre

Default locale: en_US, platform encoding: Cp1252

OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

如果现实上述信息证明安装成功。

2 找出当前maven settings.xml 和 仓库的位置

如果你有多个settings.xml 但是不清楚当前maven 是读取哪个 可以执行如下指令

默认仓库位置 $uer.home/.m2

mvn -X

...

...

[DEBUG] Reading global settings from C:\apache-maven-3.3.3\bin\..\conf\settings.

xml

[DEBUG] Reading user settings from C:\Users\jian_j\.m2\settings.xml

[DEBUG] Reading global toolchains from C:\apache-maven-3.3.3\bin\..\conf\toolcha

ins.xml

[DEBUG] Reading user toolchains from C:\Users\jian_j\.m2\toolchains.xml

[DEBUG] Using local repository at C:\maven_repo

[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for C:\m

aven_repo

通过上述信息可以查看出是读取哪个settings.xml 并且知道当前仓库local repo 的位置

3 设置自定义仓库位置

找到settings.xml 修改localRepository<

settings

>

<

localRepository

>

才:/maven_repo

localRepository

>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值