maven的setting.xml文件配置详情

<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/settings-1.0.0.xsd">

<!--本地仓库的路径,默认值为${user.home}/.m2/repository-->
<localRepository>D:\\Maven\\MavenRepository\\MavenRepository</localRepository>

<!--当插件的组织id(groupId)没有显示提供时,供搜寻插件组织Id(groupId)的列表,该元素包含一个plugGroup元素列表,每个子元素包含一个组织Id(groupId).并且没有在命令行为其提供组织Id(groupId)的时候,Maven就会使用该列表.默认情况下给列表包含了org.apach.maven.plugins和org.codehaus.mojo-->

<pluginGroups>
</pluginGroups>

<!--用来配置不同的代理,多代理profiles可以对应笔记本或移动设备的工作环境:通过简单的设置profile id就可以很容易的更换整个代理配置-->

<proxies>


</proxies>

<!-- 配 上传的账号和密码 -->

<!--配置服务端的一些设置,一些设置如安全证书不应该和pom.xml一起分发.这种类型的信息应该存在与构建服务器的setting.xml文件中-->

<servers>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<!-- 配私服镜像 , 使用所有要下载的包也通过私服下载-->
<mirrors>

<mirror>

<!---该镜像的唯一标识符,id用来区分不同的mirror元素->

<id>nexus</id>

<!--被镜像的服务器id.例如,如果我们设置了一个maven中央仓库()的镜像,就需要将该元素设置成central.这必须与中央仓库的id central完全一致.-->

<mirrorOf>*</mirrorOf>
<!-- <url>http://218.196.14.220:8081/nexus/content/groups/public</url> -->
<!-- <url>http://localhost:8081/nexus/content/groups/public</url> 
<url>http://192.168.15.100:8081/nexus/content/groups/public/</url>
<url>http://218.196.14.220:8081/nexus/content/groups/public/</url>-->
<url>http://localhost:8081/nexus/content/groups/public/</url>
</mirror>
</mirrors>

<!--根据环境参数来调整构建配置的列表,setting.xml中的profile元素是pom.xml中profile元素的裁剪版本.它包含了id,activation,repositories,pluginrepositories和properties元素.这里的profile元素只包含这五个元素是因为这只关心构建系统这个整体(这正是setting.xml文件的角色定位),而非单独的项目对象模型设置.如果一个settings中的profile被激活,它的值会覆盖任何其他定义在pom中或者profile.xml中的带有相同id的profile.-->
<profiles>
<profile>
<id>central</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>


<profile>
<id>jdk1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
</profile>

</profiles>

<!--手动激活profile的列表,按照profile被应用的顺序定义activeProfile.该元素包含了一组activePrifile元素,每个activeProfile都包含一个profile id.任何在activeProfile中定义的profile id,不论环境设置如何,其对应profile都会被激活,如果没有匹配的profile,则什么都不会发生.例如,env-test是一个activeProfile,则在pom.xml(或者在profile.xml)中的id的profile会被激活.如果运行过程中找不到这样一个profile,Maven则会像往常一样运行.-->

<activeProfiles>
<activeProfile>central</activeProfile>
</activeProfiles>
</settings>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值