工作笔记-Maven配置:settings.xml里的标签配置

Maven工程目录下,除了有pom.xml文件以外,还有一个settings.xml。 settings.xml, 包含了以下标签:

  <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                          https://maven.apache.org/xsd/settings-1.0.0.xsd">
      <localRepository/>
      <interactiveMode/>
      <usePluginRegistry/>
      <offline/>
      <pluginGroups/>
      <servers/>
      <mirrors/>
      <proxies/>
      <profiles/>
      <activeProfiles/>
    </settings>

<localRepository>就是默认的本地代码仓,默认是 ${user.home}/.m2/repository。

<interactiveMode> (命令行下)如果Maven试图与用户交互以获取输入,则为true;如果不是,则为false。默认值为true。

<usePluginRegistry> Maven是否使用${user.home}/.m2/plugin-registry管理插件版本,默认为false

<offline> 是否在离线模式下操作,默认为false。 如果连接不上远程代码仓,可以使用true。

<servers> 在<repositories>和<distributionManagement>标签下可能定义了一些远程代码仓,一些代码仓库的访问需要授权,在<servers>标签下配置访问用户和密码。

<mirrors> 为远程仓库做镜像,提高访问速率和效率。

<proxies> 用于指定一系列的profile。profile元素由activation、repositories、pluginRepositories和properties四个元素组成。当一个profile在settings.xml中是处于活动状态并且在pom.xml中定义了一个相同id的profile时,settings.xml中的profile会覆盖pom.xml中的profile。

<activeProfiles> 底包含一系列的activeProfile元素,表示对于所有的pom都处于活跃状态的profile。

 

在必要时,了解这些标签的意义,才能完成对应的配置。

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值