美文网首页
3、setttings文件

3、setttings文件

作者: chanyi | 来源:发表于2021-07-16 11:15 被阅读0次

settings是Maven的重要的配置文件,settings文件的顶层结构如下:

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

localRepository本地仓库的路径
interactiveMode如果Maven需要和用户交互以获得输入,则设置成true,反之则应为false。默认为true
usePluginRegistry如果需要让Maven使用文件plugin-registry.xml来管理插件版本,则设为true。默认为false
offline如果不能连接远程服务器,则设置为true
pluginGroups元素包含一个pluginGroup元素列表
servers服务器配置信息
mirrors镜像信息

 <mirrors>
 <mirror>
 <id>planetmirror.com</id>
 <name>PlanetMirror Australia</name>
 <url>http://downloads.planetmirror.com/pub/maven2</url>
 <mirrorOf>central</mirrorOf>
 </mirror>
 </mirrors>

proxies代理的配置
profilesprofile文件的配置信息,如果一个settings中的profile被激活,它的值会覆盖任何其它定义在POM中或者profile.xml中的带有相同id的profile
activeProfilesActivation是profile的开启钥匙。如POM中的profile一样,profile的力量来自于它能够在某些特定的环境中自动使用某些特定的值;这些环境通过activation元素指定

相关文章

网友评论

      本文标题:3、setttings文件

      本文链接:https://www.haomeiwen.com/subject/ponvpltx.html