使用Maven,正确配置settings.xml配置文件

先贴一下Maven官网关于settings.xml配置文件的使用说明:

There are two locations where a settings.xml file may live:

  • The Maven install: ${maven.home}/conf/settings.xml
  • A user’s install: ${user.home}/.m2/settings.xml

The former settings.xml are also called global settings, the latter settings.xml are referred to as user settings. If both files exists, their contents gets merged, with the user-specific settings.xml being dominant.

Tip: If you need to create user-specific settings from scratch, it’s easiest to copy the global settings from your Maven installation to your ${user.home}/.m2 directory. Maven’s default settings.xml is a template with comments and examples so you can quickly tweak it to match your needs.

Maven安装目录的settings.xml,是提供作为模版供用户使用的

Maven安装目录的settings.xml,是全局级别的配置

用户指定的settings.xml,是用户级别的配置

如果这两个级别的配置文件,都做了配置。Maven会把两个配置文件的配置内容合并,并以优先使用用户级别的配置。

日常使用Maven时,全局配置---Maven安装目录的settings.xml,建议不要做具体配置,按照maven官方文档传达的精神,当作模版使用。使用用户级别的配置文件做配置就好了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值